Is there a problem if I use DummyImage to call an image in GUI? Because the saved processed image size difference is too big compared to original image. For example,original image is 458 kB but saved image is only 98 kB.
1 次查看(过去 30 天)
显示 更早的评论
%load image
axes(handles.axes1);
handles.DummyImage = uigetfile({'*.jpg';'*.jpeg';'*.png';'*.bmp'});
guidata(hObject,handles);
I=imread(handles.DummyImage);
imshow(I);
%example of processing method
axes(handles.axes2);
L=imread(handles.DummyImage);
J=adapthisteq(L);
imshow(J);
%Save button
axes(handles.axes2);
[FileName, PathName] = uiputfile({'*.jpg';'*.tif';'*.png';'*.gif';'*.jpeg'});
Name = fullfile(PathName,FileName);
hChildAxes2 = get(handles.axes2,'Children');
W = get(hChildAxes2(1),'CData');
imwrite(W, Name,'jpg');
0 个评论
回答(1 个)
Image Analyst
2014-12-10
What format did you read in? The jpg format you saved it in may be much more compressed than the original image. You should virtually never use jpg for imaging applications, certainly not image analysis applications. Use lossless compression format PNG like most everyone else is these days.
2 个评论
Image Analyst
2014-12-11
There will be no loss of image quality if you use TIFF or PNG . There probably will be if you use jpg, but not if you use the lossless options of JPG2000.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!