doubt on how to divide by using the intensity of an image

1 次查看(过去 30 天)
hai
i am studying about optic disc localization my work is to convert a two dimensional retinal image into two one dimensional signals the input i have used is a retinal image from drive database for that i am using an algorithm
step 1 calculate the vertical and horizontal edge maps (ev,eh)using the mask[1 0 -1] and its transpose on the green component of the image step2 calculate the edgediff and edgesum which is ev-eh and ev+eh step3 next divide the edgediff by the image intensity fmap1=edgediff(x,y)/I(x,y) my doubt is how to obtain the intensity value
please help me my code is this
g=maskedRgbImage(:,:,2);
imv=conv2(double(g),[1 0 -1],'same');
figure,image((imv));
title ('Vertical Image');
imh=conv2(double(g),[1;0;-1],'same');
figure,image((imh));
title ('Horizontal Image');
ev=abs(imv);
eh=abs(imh);
edgediff=imsubtract(ev,eh);
next step is calculating the image intensity and
fmap1=imdivide(edgediff,original image)
i have divided by using the original image is it correct how to calculate the image intensity and divide thanks in advance please help me

回答(1 个)

David Young
David Young 2011-9-7
You could try using rgb2gray on the initial image. Looking at your code, this would be:
I = rgb2gray(maskedRgbImage);
then
fmap1 = imdivide(edgediff, I);
I am not certain that this is what is intended, however. The instructions do not seem to correspond to a standard algorithm: it seems a little strange to compute the differences based on the green channel alone, but then to divide by the total intensity. Another possibility is that you are simply meant to divide by g. (The purpose of subtracting the horizontal differences from the vertical differences is also hard to understand.)
If at all possible, go back to your instructor (or whoever gave you the instructions) and request clarification.
  2 个评论
ramya raj
ramya raj 2011-9-7
thanks for your immediate response
actually i am working with the journal paper to locate the optic disc and the algorithm is as follows
1. Define a sliding window with dimensions (image
height, 2 main vessel width)
2. Get an image of horizontal edges (EH) and an image
of vertical edges (EV)
3. Calculate EdgeDiff = |EH| - |EV|; where |.| is the
absolute operator
4. Slide the window over the image from right to left
and at each location,
i) Calculate F = sum of EdgeDiff
ii) Calculate G = sum of pixels’ intensity values
iii) Calculate the ratio Hposition = F / G
5. The horizontal location of the optic disc (OD_H) is
the location of the maximum value in Hposition
this is what i am doing
i have calculate the edge difference and i don't know how to divide by using the intensity.
David Young
David Young 2011-9-7
Without implementing the system myself from the journal paper, I don't think I can offer more advice. My suggestion above about how to do the division still stands.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by