Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

image quality goes off when GETIMAGE is used in MATLAB

1 visualización (últimos 30 días)
Chethan
Chethan el 23 de Ag. de 2013
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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 comentario
Chethan
Chethan el 23 de Ag. de 2013
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

Respuestas (1)

Walter Roberson
Walter Roberson el 23 de Ag. de 2013
To solve the original problem you had that you dealt with in stackoverflow:

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by