I would appreciate if someone can briefly outline on how one can generate a 5x5 edge detection mask using an ideal step function: S(x,y)={(a for (xcosθ+ysinθ)<ρ AND a+h for (xcosθ+ysinθ)≥ρ)} which can be geometrically represented as follows:
I actually need to generate a mask so that I can apply it onto an image to detect edges. I would appreciate if someone can give me a detailed or high level idea.
Thank you,

 채택된 답변

Image Analyst
Image Analyst 2015년 2월 10일

0 개 추천

Did you try a for loop over row and columns and use your formula:
for col = 1 : 5
for row = 1 : 5
rho = sqrt((row-2)^2+(col-2)^2);
theta = atand2(row/col);
and so on... Give it a try - it's not that hard. Remember x is column and y is row.

댓글 수: 3

mona
mona 2015년 2월 11일
This is clearing up a bit but I do have another question.
So this means that rho and theta are computed within the loop for varying values of x and y. Then the values are embedded into the conditional statements within S(x,y) to check whether the conditions are satisfied or not. Depending on this 'a' or 'a+h' are assigned for each element within the kernel, am I right or I'm missing something?
mona
mona 2015년 2월 11일
I am mainly referring to page 21, section 9.2 in the following link: http://disp.ee.ntu.edu.tw/henry/edge_detection.pdf
Here, x matrix given in (55) is generated from equation (37).
Image Analyst
Image Analyst 2015년 2월 11일
Yes, you assign either a or a+h depending on if the center of the pixel is in the circle or shaded part.
His email is given in the paper and he said he had MATLAB code. Why don't you just ask him for the code?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

질문:

2015년 2월 10일

댓글:

2015년 2월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by