Toolbox ia870 | List of Figures | Fig. 6.31 | Fig. 7.2

Figure 7.1 - Segmentation by thresholded gradient

Description

This figure illustrates the segmentation by thresholded gradient.

Demo Script

 1 import numpy as np
 2 import ia870 as MT
 3 
 4 f = np.transpose(adreadgray('beef.tif'))
 5 g = MT.iagradm(f,MT.iasebox())
 6 g50 = g >= 50
 7 g100= g >= 100
 8 
 9 adshow(f,'(a) input image')
10 adshow(MT.iapad(MT.ianeg(g)),'(b) morphological gradient')
11 adshow(MT.iapad(MT.ianeg(g50)),'(c) low threshold')
12 adshow(MT.iapad(MT.ianeg(g100)),'(d) high threshold')

(a) input image

(b) morphological gradient

(c) low threshold

(d) high threshold