Maximal Max-tree Simplification Methodology

MainPage || iamxt

 1 import iamxt
 2 import numpy as np
 3 import ia636
 4 
 5 # Parameters of the method
 6 option = "MSER" #Options "MSER" "T"
 7 n = 15
 8 attr = "area"
 9 
10 #Reading and displaying image
11 img = adreadgray('/awmedia/www/media/Attachments/iamxt-tutorial/interactive_maxtree01/MRI_sagittal.png')[:,::-1].copy()
12 
13 Bc = np.ones((3,3),dtype = bool)

Do it yourself

Apply the maximal max-tree simplification methodology to the license plate image in a way that all plate characters are preserved.

 1 img =adreadgray(find_attachment_file('lp.png'))
 2 print find_attachment_file('lp.png')
 3 
 4 adshow(img,'License plate image')
 5 
 6 img_neg = img.max() - img
 7 adshow(img_neg,'Negative - License plate image')
 8 mxt = iamxt.MaxTreeAlpha(img_neg,Bc)
 9 
10 ext = mxt.computeExtinctionValues(mxt.computeVolume(),"volume")
11 
12 
13 # Result of the extinction filter
14 mxt.extinctionFilter(ext,n)
15 img_ef = mxt.getImage()
16 adshow(img_ef, 'Image after the Extinction %s Filter (%d nodes)' % (attr,mxt.node_array.shape[1]))
17 
18 
19 sm = mxt.computeStabilityMeasure()
20 mxt.mmsMSER(sm)
21 img_mms= mxt.getImage()
22 adshow(img_mms, 'Image after the EF + MMS-%s, (%d nodes)' % (option,mxt.node_array.shape[1]))
23 
24 
25 area = mxt.node_array[3,:]
26 mmgraphviz(mxt.generateCCGraph(parent_scale = False),"Resulting max-tree")
/awmedia/www/media/Attachments/iamxt-tutorial/iamxt01_mms_methodology/lp.png

License plate image

Negative - License plate image

Image after the Extinction area Filter (1202 nodes)

Image after the EF + MMS-MSER, (28 nodes)

/media/_xsb/iamxt-tutorial/iamxt01_mms_methodology/GRVIZ09376_001.png

Resulting max-tree