Image Processing Reference
In-Depth Information
disp (' ')
disp ('We detect all edges by combining the vertical and horizontal
edges')
%so we'll call the edge operator
all_edges=edge(eye);
subplot(1,1,1), imagesc(all_edges);
plotedit on, title ('All edges of an eye'), plotedit off
pause;
function edges=edge(image)
%Find all edges by first order differencing
%
%Usage: [new image]=edge(image)
%
%Parameters: image-array of points
%
%Author: Mark S. Nixon
%get dimensions
[rows, cols]=size (image);
%set the output image to black
edges=zeros (rows, cols);
%then form the difference between horizontal and
vertical points
for x=1: cols-1 %address all columns
for y=1: rows-1 %address all rows except border
edges (y,x)=abs(2*image(y,x)
image (y+1, x)-image (y, x+1));
All edges of an eye
10
20
30
40
end
end
50
60
10
20
30
40
50
60
Detecting all edges
disp (' ')
disp ('The Roberts operator is actually one of the oldest edge
detection')
disp ('operators. The edges are the maximum of the difference between')
disp ('points on the two diagonals.')
%so we'll call the Roberts cross operator
roberts_edges=roberts(eye);
imagesc(roberts_edges);
plotedit on, title ('Eye edges by Roberts cross operator'), plotedit
off
pause;
Search WWH ::




Custom Search