[maxthresholdlabelcount] [Up] Demonstrations

mmdvlpl
Vehicle License Plate Localization.

Description

This procedure finds the image region that contains the vehicle license plate.

Demo Script

Reading

The gray-scale image of the vehicle is read. As we intend to use a MaxTree, the image is inverted so that the characters of the plate become image intensity peaks.

hmin = 10
hmax = 30
wmin = hmin/3
wmax = (3*hmax)/4
#
input = mmreadgray('MDX4422.jpg')
a = mmneg(input)
mmshow(input)
mmshow(a)
input a

Connected component filtering using a MaxTree

Here we build a MaxTree from the input image and apply a sequence of connected filters known as attribute openings. Each filter is implemented as a prunning of the tree and returns a new MaxTree. The filters are as follows.

  1. Bounding box top hat. The resulting MaxTree contains only components with bounding box lesser than wmax x hmax. This is like a sieve with a mesh of the specified size. Top hat means that we keep the components that passed the sieve.
  2. Bounding box width. The components with bounding box width lesser than wmin are pruned out.
  3. Bounding box height. The components with bounding box width lesser than hmin are pruned out.
  4. Volume. This filter is equivalent to the mmvmax.

mt1 = maxtree(a)
mt2 = maxaopenthmt(mt1, 'bbox', wmax, hmax)
mt3 = maxaopenmt(mt2, 'bbox', wmin, 1000)
mt4 = maxaopenmt(mt3, 'bbox', 1000, hmin)
mt5 = maxaopenmt(mt4, 'volume', 500)
b = maxgetimage(mt5)
mmshow(maxgetimage(mt2));
mmshow(maxgetimage(mt3));
mmshow(maxgetimage(mt4));
mmshow(b);
maxgetimage(mt2) maxgetimage(mt3)
maxgetimage(mt4) b

[maxthresholdlabelcount] [Up]