Demo iadrobotop

namespace:morph
page:iadrobotop

Detect marks on a robot.

Description

The input-image is a gray-scale image of a rounded-shaped robot, viewed by a camera mounted on the ceiling. The procedure detects two white marks on top of the robot. This is a typical example of application of the top-hat operator in image segmentation.

Script

Reading

The gray-scale image of the robot top view is read.

1. a = mmreadgray('robotop.tif');
2. mmshow(a);

Open top-hat

It detects white regions smaller than a square of radius 4.

1. from ia870 import iaopenth
2. from ia870 import iasebox
3. 
4. 
5. b = iaopenth(a,iasebox(4));
6. mmshow(b);

Opening

It removes white objects smaller than a square of radius 1.

1. from ia870 import iaopen
2. 
3. 
4. c = iaopen(b,iasebox());
5. mmshow(c);

Thresholding

It detects the robot markers. This is a very robust thresholding (i.e., the result is not sensible to small changes in the value of the threshold parameter). The original image is overlayed by the detected robot markers.

1. from ia870 import iathreshad
2. 
3. 
4. d = iathreshad(c,100);
5. mmshow(a,d);