mercredi 4 mars 2015

MATLAB Grayscale showing RGB output

I'm using these lines of code to convert an RGB image to grayscale.



% ===========================
% GRAYSCALE IMAGE
% ===========================
% --- Executes on button press in btnGrayscale.
function btnGrayscale_Callback(hObject, eventdata, handles)
global origImage;
imageGray = rgb2gray(origImage);
axes(handles.axesEdited);
image(imageGray);


The output doesn't show a grayscale image though.


enter image description here


What seems to be the problem? I'm running MATLAB 6.5 on Windows 7, by the way.


Aucun commentaire:

Enregistrer un commentaire