ENT 273 Object Recognition and Feature Detection Hema C.R. Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7
Road Map Feature Extraction Contour Chain codes Object Recognition Object Representation Feature Detection Hough Transform Fourier Descriptors Hema ENT 273 Lecture 7
Contour Represented as ordered list of edges or a curve Criteria for good contour Efficiency: simple and compact representation Accuracy: accurately fit image features Effectiveness: suitable for operations to be performed at a later stage Hema ENT 273 Lecture 7
Definitions Edge list Contour Boundary Ordered set of edge points or fragments Contour Edge list or a curve that is used to represent the edge list Boundary Closed contour that surrounds a region Note: The term edge generally refers to edge points Hema ENT 273 Lecture 7
Object Recognition Object recognition systems find objects in the real world from an image of the world. Object recognition can be defined as a labeling problem based on models of known objects. Hema ENT 273 Lecture 7
OBJECT RECOGNITION The next step in Robot Vision is the Object Recognition. This problem is accomplished using the extracted feature information. The object recognition algorithm is to be powerful and fast so that the required object is uniquely recognized. There are mainly two methods Template matching technique A template is provided to computer and the computer is trained to match the object with the template irrespective of object orientation. Hema ENT 273 Lecture 7
Structural technique Several structural techniques are available. These may take the features also in to account. We discuss a common method known as Hema ENT 273 Lecture 7
Chain Codes Notation for recording list of edge points along contour Chain code specifies the direction of the contour at each edge Directions are quantized into one of eight directions These codes are also known as freeman codes Are used for the description of pixel border Local information of the objects can be obtained from the chain code E.g. where image border turns 90 degrees etc. CHAIN CODE. Here there are two approaches (a) 4-Directional Chain Code (b) 8 Directional Chain code Hema ENT 273 Lecture 7
Start with the start point and go along the arrows 4-directional converter 8-directional converter 1 2 3 4 5 6 7 OBJECT Start with the start point and go along the arrows Comparing the contour of object with respect to 4-directional chain code converter, we get Chain code of Object: 03032211 START Hema ENT 273 Lecture 7
We then get the difference; CHAIN CODE : 03032211 We then get the difference; Difference between 0 and 3 is 3 (ref 4 direc. converter) Difference between 3 and 0 is 1 Difference between 0 and 3 is 3 and so on Difference between 1 and 1 is 0 Difference between 1 and 0 is 3. Difference Code is : 31330303 Take the minimum (decimal)value of Difference code as This SHAPE number is for the object, uniquely recognized, independent of rotation (by 900). Normally chosen from Difference Code of smallest order Hema ENT 273 Lecture 7
Another Object Verify: Chain Code: 0330011033323333221112111 Difference code: 3010103300310003030013003 Shape Number: 0003030013003301010330031 Hema ENT 273 Lecture 7
If the object edges are of slopes 450, 1350 , - 450 and - 1350, then we can use the 8-Directional converter. The procedure of getting the shape number is the same. This method of object recognition is fast and can be used for different shapes of objects to be recognized if they are coming in a random sequence. Hema ENT 273 Lecture 7
Chain coding example 2 3 4 1 5 8 7 6 3 5 6 7 1 2 Hema ENT 273 Lecture 7
Components of a object recognition system Model database – model base Feature detector Hypothesizer Hypothesis verifier Feature Detector Hypothesis Formation verification Modelbase Image Features Candidate objects Object Class Hema ENT 273 Lecture 7
Components Model Database Feature Detector Hypothesizer Contains all models known to the system for recognition –such as size, color, shape, CAD drawing etc Feature Detector Applies operators to images and identifies location of features that help the object hypothesis Hypothesizer Assigns likelihood to objects using features detected and selects object with highest likelihood Hypothesis Verifier Uses object models to select most likely object Note: Depending on the complexity of the problems one or more modules becomes trivial. Hema ENT 273 Lecture 7
Object Representation Observer-Centered Representation Applied to objects relatively in stable positions w.r. to camera Global features of a scene are recognized Features are selected based on experience of designer or analyzing features to form object groups Object-Centered Representation Uses description of objects based on usually 3D Independent of camera parameters Used in constructive solid geometry e.g. CAD / CAM Hema ENT 273 Lecture 7
Recognition Strategies Object recognition is a sequence of steps that is performed after appropriate features have been detected. Not all object recognition techniques require strong hypothesis formation and verification steps Hypothesizer Classifier Features Object Verifier Sequential Matching Features Object Hypothesizer Verifier Features Object Hema ENT 273 Lecture 7
Strategies Classification Matching Nearest neighbor Similar features in a region are clustered, based on a centroid and distance Bayesian Classifier Used when distribution of objects is not straightforward When there is an overlap of features of different objects. Probabilistic knowledge about features and frequency of objects is used Neural Nets Implement a classification approach Use nonlinear boundary partition of features Boundaries are used by training a net Off-line computations Computations are done before recognition Recognition process can be converted to a look-up table Matching Feature Matching Known features of the object are matched with unknown objects feature to find matches Symbolic Matching Relation among features are matched Graph matching Hema ENT 273 Lecture 7
Feature Detection Global Features Local Features Relational Features Characteristic of a region Area Perimeter Fourier Descriptors Moments Local Features Features on the boundary of an object or a small region Curvature Boundary segment Corners Relational Features Based on relative positions of different entities like regions, closed contours etc. Distance between features Used in defining composite objects Hema ENT 273 Lecture 7
FEATURE EXTRACTION: In vision, it is often necessary to distinguish one object from another. This is accomplished by mean of features that uniquely characterize the object. Some features of objects that can be used in Vision are: (a) Area (b) Minimum Enclosing rectangle (c) Diameter (d) center of gravity Perimeter (f) eccentricity (g) Aspect Ratio (h) Number of holes (i) Moments Hema ENT 273 Lecture 7
EXAMPLE: Let an original image of an object undergone several image processing techniques and finally available to us as a pixel pattern shown below: Hema ENT 273 Lecture 7
Some of features can be computed as: Moment ( M00 ) = = 24 Eccentricity = (Max x-length) / (Max y-length) = 9/4 Perimeter = 22 Area = 24 Diameter = 9 Thinness = {Diameter / area } = ( 9 / 24 ) = 0.375 (g) compactness = { (perimeter)2 / area } = ( 22 2 /24 ) No: of holes = 0 Objects having these features belong to one category Hema ENT 273 Lecture 7
Example of Histogram Hema ENT 273 Lecture 7
Hema ENT 273 Lecture 7
Hema ENT 273 Lecture 7
Hema ENT 273 Lecture 7
Center of Gravity (COG) Image Area Center of Gravity (COG) Or centroid for xc and yc. The area and COG is used to identify the position of the object Hema ENT 273 Lecture 7
Moments- A sequence of numbers characterzing the shape of an object The sum of power (j+k) is the order of themoment Hema ENT 273 Lecture 7
If the COG is known we can determine the central of moment Because object is balanced at COG, the first order moment is zero Hema ENT 273 Lecture 7
The second order moment give the moment inertia of the image Hema ENT 273 Lecture 7
Orientation-the angle of inclination Hema ENT 273 Lecture 7
Eccentricity- maximum chord length is along the principal axis or major axis of object and minimum chord length is perpendicular to major axis Hema ENT 273 Lecture 7
Aspect Ratio=Length of Rectangle enclosing object Roundness, Aspect Ratio=Length of Rectangle enclosing object Width of rectangle enclosing Object Hema ENT 273 Lecture 7
Example of Object Recognition Hema ENT 273 Lecture 7
Hema ENT 273 Lecture 7
Hema ENT 273 Lecture 7
Machine Vision Object Recognition and Feature Detection Hema C.R. End of Lecture 7