Question

i'm trying to display edge image(using Canny edge detector) in axes(axes4). The code below work out, but somehow the edge image is displayed in blue-ish

axes(handles.axes4);
imh=image(CannyImage1);
resultImage=CannyImage1;
axis off;
axis image;
guidata(hObject, handles);

get(handles.axes4);

i need to make the resulted image become more clearer(the edge become more obvious) as the image was intended for display. help me understand why the image turn out like that and please suggest idea to fix it(back to basic black and white edge image)...Thank you...

Was it helpful?

Solution

The problem is that the 'image()' command doesn't scale your image, so the difference between 0 and 1 is very small and not properly displayed. If you use the 'imagesc()' command instead, your image will be automatically scaled and the edges will be visible. If you then want it in black-white instead of color you have to set the colormap accordingly, that is:

imagesc(CannyImage1);
colormap('gray')

Alternativly, if you have the image processing toolbox, you can use the 'imshow()' command instead, I find it better to use when working with images.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top