Save- path for image using the function "imwrite()"
古いコメントを表示
Hi
when I use the imshow() function, I know that I have the image that I want to display in one of the files in the *MATLAB path.
For instance, when I take a picture with my webcam, I want to save it by using imwrite.
where has the image been written to?
Matar Maoz
採用された回答
その他の回答 (1 件)
Jan
2011 年 2 月 13 日
IMWRITE writes to the current folder, so these two commands are equivalent:
image = rand(100, 100, 3);
imwrite(image, 'File.png')
imwrite(image, fullfile(cd, 'File.png'))
The later method can be used to specifiy the wanted directory.
5 件のコメント
matar maoz
2011 年 2 月 13 日
Walter Roberson
2011 年 2 月 14 日
imwrite() needs the first argument to be the image matrix to write.
Jan
2011 年 2 月 14 日
I've inserted [image] in the example. To get help about IMWRITE, type "help imwrite".
ayushi
2016 年 7 月 21 日
suppose if we want to check that if in a variable "R" some image exist like "Image1" then imshow(image2) how to do this?
Walter Roberson
2016 年 7 月 21 日
if ~isempty(R) && ndims(R) < 4 && (isnumeric(R) || islogical(R))
disp('R contains an image');
end
Or did you mean that R contains the name of a file that contains an image?
if exist(R, 'file')
try
imfinfo(R);
%if we got here then R does name an image. So for some reason now we are supposed to display a different image
imshow(image2);
catch
%R names a file that is not an image
end
else
%R does not name a file
end
カテゴリ
ヘルプ センター および File Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!