How to save the proceesed image in the same size as input image

3 次查看(过去 30 天)
Hi,
I need to save the proceesed image in the same size (width and height) as the input image. I tried below script, but it still saves teh image in the smaller size than the input same.
width=2472;
height=2062;
set(gcf,'position',[x0,y0,width,height])
  3 个评论
MechenG
MechenG 2025-5-3
And I need to save my image without any axis. For this I am using axis off command

请先登录,再进行评论。

采纳的回答

Matt J
Matt J 2025-5-3
outputImage=imresize(outputImage,OutputSize=size(inputImage));
imwrite(outputImage , filename);
  6 个评论
Image Analyst
Image Analyst 2025-5-3
You could do it more simply like this:
outputImage = mat2gray(GMag); % Convert to gray scale image in the range 0-1.
imwrite(outputImage, 'output.png'); % Will save as PNG in the range 0-255.
No need for calling im2uint8(), and ind2rgb(), and gray(), unless for some reason you wanted your grayscale image to be a true color RGB image (but still appearing as grayscale).

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Modify Image Colors 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by