How to save the proceesed image in the same size as input image
조회 수: 2 (최근 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])
채택된 답변
Matt J
2025년 5월 3일
outputImage=imresize(outputImage,OutputSize=size(inputImage));
imwrite(outputImage , filename);
댓글 수: 6
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 Center 및 File Exchange에서 Modify Image Colors에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!