I am trying to understand the concept of Non-maximum suppression(Canny Edge detection), So I started looking at the matlab code. The part of matlab code to determine the direction of the edge is shown below.
switch direction
case 1
idx = find((iy<=0 & ix>-iy) | (iy>=0 & ix<-iy));
case 2
idx = find((ix>0 & -iy>=ix) | (ix<0 & -iy<=ix));
case 3
idx = find((ix<=0 & ix>iy) | (ix>=0 & ix<iy));
case 4
idx = find((iy<0 & ix<=iy) | (iy>0 & ix>=iy));
end
Here,
- ix:input image filtered by derivative of gaussian along x
- iy:input image filtered by derivative of gaussian along y
- case 1: 0-45degrees or 181-225degrees
- case 2: 46-90degrees or 226-270degrees
- case 3: 91-135degrees or 271-315degrees
- case 4: 136-180degrees or 316-360degree
How are the conditions inside the switch cases corresponds to the cases explained below the code. Could any one please explain this. ?