I have a code :
image=imread('geranium.jpg');figureimshow(image)imR1=image(:,:,1);imG1=image(:,:,2);imB1=image(:,:,3);gray = uint8(0.299*double(imR1) + 0.587*double(imG1) + 0.114*double(imB1));%opening operation
di = strel('line',50,100);dilate = imdilate(gray,di);er = strel('line',50,100);erode = imerode(dilate,er);%difference image between opening operation and grayscale
difference_image = double(gray) - double(erode);figure; % Open up another figure window.
subplot (2,2,1)imshow(dilate)subplot (2,2,2)imshow(erode)subplot(2,2,3)imshow(difference_image, []); % Display the difference image.
the difference_image's variable result is
what should I do to enchant the difference_image into this figure below?
I have tried histeq, but the result is all black
Best Answer