Info

此问题已关闭。 请重新打开它进行编辑或回答。

image quality goes off when GETIMAGE is used in MATLAB

1 次查看(过去 30 天)
In my GUI I've so many operations to perform on image. Including crop,_flip_,_resize_ etc., below code shows some of such functions. In my opening function i took the image from previous window
function Pre_processing_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
fname = getappdata(0, 'fname');
axes(handles.axes1);
imshow(fname);
[path,name,ext,ver] = fileparts(fname);
handles.fname = strcat(name,ext);
[handles.queryx, handles.querymap] = imread(fname);
guidata(hObject, handles);
For flip
function Flip_H_Callback(hObject, eventdata, handles)
a = getimage(handles.axes1);
hflip = flipdim(a,2);
axes(handles.axes1);
imshow(hflip);
guidata(hObject, handles);
For rotate
function rotate_Callback(hObject, eventdata, handles)
a = getimage(handles.axes1);
Ra = get(handles.angle, 'string');
Na = str2num(Ra);
rotate = imrotate(a,Na);
axes(handles.axes1);
imshow(rotate);
guidata(hObject, handles);
I've shown only 2 functions, but so many similar functions are there in my GUI. Figure shown below is original image http://s1273.photobucket.com/user/Chethan_tv/media/untitled_zps68c1621d.jpg.html
The moment i press flip (for example) then image quality goes off as shown below http://s1273.photobucket.com/user/Chethan_tv/media/untitled1_zpsc748c3a7.jpg.html
mages I'm using are of 8 bit depth and BMP format. why is this change?
  1 个评论
Chethan
Chethan 2013-8-23
Before using this getimgae i was using ind2rgb to convert my bitmap images to RGB. At that time i was getting correct output.
fname = getappdata(0, 'fname');
[a, map] = imread(fname);
x = ind2rgb(a, map);
i just replaced above lines with getimage

回答(1 个)

Walter Roberson
Walter Roberson 2013-8-23
To solve the original problem you had that you dealt with in stackoverflow:

标签

Community Treasure Hunt

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

Start Hunting!

Translated by