Tuesday, February 10, 2009

Shape and size recognition of complex pictures

The Challenge
Shape is an important cue as it captures a prominent element of an object. While humans
can effortlessly recognize thousands of object shapes despite changes in illumination,
pose, articulation, etc., it has so far not been possible to mimic similar competence in a
computer. This is mainly because the amount of visual information present in the real
world is clearly immense and recognizing objects from visual information is challenging.
Recognition remains challenging in large part due to the significant variations exhibited
by real-world images like Partial occlusions, viewpoint changes, varying illumination and
cluttered backgrounds .Human beings are equipped with a vision system that captures the
images of objects and sends them to the brain. Based on the signals received from the
brain, human beings do path planning effectively according to the nature and size of the
obstacles that are present in the way. But then a similar method has to be devised for A
Self navigating robotic vision that enables it to recognize the shape and size of objects for
effective path planning. That is the main Challenge
The Solution
To devise a method to identify the shape and o calculate the relative sizes of objects in a
given complex picture using National Instruments Lab View software
Introduction
Self navigating robot is a robot which is endowed with the capability for automatic
discovery of high-level perceptual features and hence performs large-scale actions for
learning to navigate in continuous environments In general all kinds of robots have a
vision system equipped with camera which acts as electronic eye for the robot. Vision is
one of the main parameter for effective functioning of any kind of robot. More so for a
self navigating robot because it is expected to do a lot of path planning beforehand so
That it can navigate on its own very effectively without any manual programs
System Implementation
The project is mainly divided into two modules namely shape recognition and size calculation
Shape recognition module
For shape recognition, first of all two databases one containing images of complex
pictures and the other containing images of different shapes is created This is done using
image extract method which involves specifying the source image window and target
image window and then extracting the image from the source and storing it in the target
image path in which the databases need to be created.
Then given an input image, the edges of all the objects in the image are enhanced
and all other parts of the image are made black. Using Thresholding VI.. The edge
information of the objects in the given picture is given as input to the pattern matching
VI.. The pattern matching first learns the edge pattern using learn pattern VI and then
compares it with the pattern of all the shapes present in the database. If it finds a suitable
match, it displays the name of the shape along with the number of such shapes present in
the given input picture.
Figure 1: Results for image extraction from image database
Figure 2: Result for image extraction from shape database
Figure 3: Appearance of output screen for shape recognition
Figure 4: Input image given for shape recognition
Figure 5: Final results for Shape recognition
Size calculation module
For size calculation, first of all pictures of objects at three fixed distances from the field
of view of the camera are taken. Then the objects are separated from the background
using Thresholding VI .Then the total number of pixels of every object at each of these
distances is calculated. Then a database containing the images of objects at different
distances along with the values of total number of pixels present in them is created.
Given an input picture, objects in the picture are separated form the background and are
compared with the objects in the image size database using the pattern matching VI. If a
match is found, the distance of the object from the camera is checked. If the distance is
any value other than the distance stored in the database, values of total number of pixels
versus distance are calculated using Interpolation VI.
The value of total number of pixels is converted to real world units using a spatial
calibration mechanism which is based on mapping of total number of pixels to real world
units using the formula derived by me. I derived the formula by calculating the total
number of pixels and the real world dimensions of a large number of objects and then
deriving a correspondence between the two which will henceforth stand valid for all other
objects also. The correspondence that is derived is
Physical Area = Total number of pixels/4 pixels per sq.mm.
This formula can be used to calculate the real world measurement of any given object in
terms of square millimeters.
Figure 6: Initial screen for Size calculation
Figure 7: Final output screen for size calculation
Conclusion
Testing has been carried out extensively using different target images. Image database
has been created with extensive care to include all probable minimal sets of images.
Results are highly satisfactory as testing has been carried out with a large number of
complex pictures each containing different shapes. The different shapes in each picture
were displayed along with the number of such shapes present in the given picture. It was
observed that even if the sizes of the image in the database was different form the size of
the object images present in the database, the shapes were identified correctly.
The size recognition module also gave very good results during testing. Real time
measurements of large number of objects were taken and their values were compared
with the values computed by the program. The values were found to be approximately
equal

No comments: