
Image Segmentation 243
and
MATLAB/Octave
>> edge
_
s = edge(s,’sobel’);
>> figure,imshow(edge
_
s)
The appearance of each of these can be changed by specifying a threshold level.
(a) Roberts edge detection (b) Sobel edge detection
FIGURE 9.21: Results of the Roberts and Sobel filters
The Python outputs, with
Python
In : edge
_
r = fl.roberts(s)
In : edge
_
s = fl.sobel(s)
are shown in Figure 9.22. Of the three filters, the Sobel filters are probably the best; they
(a) Roberts edge detection (b) Sobel edge detection
FIGURE 9.22: Results of the Roberts and Sobel filters in Python
provide good edges, and they perform reasonably well in the presence of noise.