Image resizing and saving using imwrite
이전 댓글 표시
hi...i need to resize the images to 512x512 and then save the image....m using imwrite to save but it saving it as blank images...my code is as below...plz help asap..
a=imread('1.jpg');
b=double(a)+1; %converting uint to double
c=imresize(b, [512 512]);
imwrite(c,'1f.jpg');
figure,imshow(a,[]);
figure,imshow(c,[]);
댓글 수: 2
Jan
2014년 4월 14일
@Horia: setting a flag is though to inform the admins about a question which conflicts with the terms of conditions. So please remove this flag and post a new question instead. Thanks.
Image Analyst
2014년 4월 14일
I moved it.
채택된 답변
추가 답변 (1개)
Image Analyst
2012년 4월 27일
0 개 추천
Don't convert to double. jpg images expect uint8 values.
댓글 수: 3
kunal bhandari
2012년 4월 27일
kunal bhandari
2012년 4월 27일
Image Analyst
2012년 4월 27일
If you want to save double images and will use them only in MATLAB, then I recommend saving them as a .mat file. If you want a visualization so that you can see them in other programs, like a jpg file, then use 255 * mat2gray() to scale to 0-255 before saving in a standard format like BMP, TIF, PNG, JPG, etc.
카테고리
도움말 센터 및 File Exchange에서 Read, Write, and Modify Image에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!