我有一系列圖像保存在一個文件夾中,我寫了一個簡短的程序來打開這些圖像文件中的兩個,連接它們(最好是垂直,儘管現在我正在水平嘗試),然後將此新圖像保存到相同的文件夾中。這是我至今寫:連接來自文件夾的圖像
function concatentateImages
%this is the folder where the original images are located path='/home/packremote/SharedDocuments/Amina/zEXAMPLE/';
file1 = strcat(cr45e__ch_21', '.pdf');
[image1,map1] = imread(graph1);
file2 = strcat('cr45f__ch_24', '.jpg');
[image2,map2] = imread(graph2);
image1 = ind2rgb(image1,map1);
image2 = ind2rgb(image2,map2);
image3 = cat(2,image1,image2);
%this is the directory where I want to save the new images
dircase=('/home/packremote/SharedDocuments/Amina/zEXAMPLE/');
nombrejpg=strcat(dircase, 'test', jpgext)
saveas(f, nombrejpg, 'jpg')
fclose('all');
不過,我不斷收到一個錯誤,我的文件不存在,但我敢肯定的名稱正確地複製。
我目前使用jpg文件,但格式可以很容易地轉換。
有關如何解決此錯誤的任何輸入信息,或執行此任務的更好方法,我們深表感謝!
乾杯,
阿米娜