
100 A Computational Introduction to Digital Image Processing, Second Edition
High pass filters are often used for edge detection. These can be seen quite clearly in
the right-hand image of Figure 5.10.
In Python, as we have seen, the
convolve
operation returns a
uint8
array as output
if the image is of type
uint8. To apply a linear transformation, we need to start with an
output of type
float32:
Python
In: cf2 = ndi.convolve(float32(c),f,mode=’constant’)
In: maxcf2 = cf2.max()
In: mincf2 = cf1.min()
In: cf2f = (cf2-mincf2)/(maxcf2-mincf2)
In: io.imshow(cf2f)
Note that Python’s
imshow
commands automatically scale the image to full brightness
range. To switch off