how to give test image path correctly?
34 ビュー (過去 30 日間)
古いコメントを表示
When i give the path like this I am getting this error*
File "~\Desktop\ME project\images\bungee.png" does not exist.
origImg = imread([testImageSource,'.png']);
PROGRAM*
clear
%%parameters
testImageName = 'bungee'; % cow or bungee or man
psz = 9; % patch size ( to be inpainted in inpainting)
testImagePath = '~/Documents/MATLAB/AutoShared/testimages/Petter_Strandmark/';
testImageSource = fullfile(testImagePath,testImageName);
origImg = imread([testImageSource,'bungee.png']);
mask = imread([testImageSource,'bungee-mask.jpg']);
mask(mask==255) = 1;
tic
%output is fix!
[inpaintedImg,c,d,fillingMovie] = inpainting(origImg,mask,psz);
toc
maskedImg = repmat(uint8(~mask),[1,1,3]).*origImg;
figure(1),imshow(uint8(origImg)),title('Original Image')
figure(2),imshow(uint8(maskedImg)),title('Masked Image')
figure(3),imshow(uint8(inpaintedImg)),title('Inpainted Image')
folderName = ['myresults/',datestr(now,'yymmdd-HHMMSS'),'_',testImageName];
mkdir(folderName)
imwrite(uint8(origImg),fullfile(folderName,'origImg.bmp'),'BMP');
imwrite(uint8(maskedImg),fullfile(folderName,'maskedImg.bmp'),'BMP');
imwrite(uint8(inpaintedImg),fullfile(folderName,'inpaintedImg.bmp'),'BMP');
2 件のコメント
Stephen23
2015 年 11 月 8 日
@Meena s: please do not post duplicate questions on the exactly the same problem. Instead of spamming us with your new questions please simply edit or comment your existing question.
Because this question has the most information I closed the other questions.
Pavankumar Dani
2021 年 11 月 17 日
imagePath = fullfile('testImages','patna.png');
originalImage = imread(imagePath);
getting error
回答 (1 件)
Star Strider
2015 年 11 月 8 日
Use the full path name. It is probably
C:\Users\<UserName>\Desktop\ME project\images\bungee.png
Where you would fill in your UserName in the appropriate location.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!