Machine Vision
Machine Vision
Machine Vision
Engineering 7854
Industrial Machine Vision
LECTURE OUTLINE
Elements of a Machine Vision System
Lens-camera model 2D versus 3D machine vision
Object recognition
Blob analysis, generalized moments, compactness Evaluation of form parameters from chain and crack codes
Industrial application
10/19/2013 Introduction to Machine Vision
10/19/2013
LENS-CAMERA MODEL
10/19/2013
If the form (i.e., size) of the object is known, its position and orientation can be determined from a single perspective view. Employ an additional range sensor (ultrasonic, optical).
10/19/2013 Introduction to Machine Vision
Laser Projector
Digital Camera
Field of View
10/19/2013
10/19/2013
10/19/2013
10/19/2013
10/19/2013
In all of these examples, the description refers to specific objects or regions in the image.
To generate the description of the image, it is first necessary to segment the image into these regions.
10/19/2013 Introduction to Machine Vision
IMAGE SEGMENTATION
How many objects are there in the image below? Assuming the answer is 4, what exactly defines an object?
Zoom In
10/19/2013
194
196 192
193
194 190
192
194 189
192
195 189
192
195 192
194
196 192
194
195 192
193
194 191
192
193 192
193
193 190
193
193 192
192
194 194
192
193 194
192
195 194
189
194 193
173
192 192
129
185 192
84
150 187
62
99 163
52
69 114
10/19/2013
200
150 100 50 0
10/19/2013
10/19/2013
10/19/2013
BINARY IMAGE
10/19/2013
10/19/2013
Pi,j
Pi,j
10/19/2013
EQUIVALENCE: B=C
B B B B B
C C C C
B B B
B B B
10/19/2013
TWO OBJECTS!
B B B B B
C B C B C B C B
B B B
B B B
10/19/2013
10/19/2013
10/19/2013
10/19/2013
IS THERE A MORE COMPUTATIONALLY EFFICIENT TECHNIQUE FOR SEGMENTING THE OBJECTS IN THE IMAGE?
Contour tracking/border following identify the pixels that fall on the boundaries of the objects, i.e., pixels that have a neighbor that belongs to the background class or region. There are two standard code definitions used to represent boundaries: code definitions based on 4connectivity (crack code) and code definitions based on 8-connectivity (chain code).
10/19/2013
1
CRACK CODE:
10111211222322333300 103300
10/19/2013
CHAIN CODE:
12232445466601760
10/19/2013
V Q U P
Q P V U
P U Q V
U V P Q
10/19/2013
*Implement
as a modulo 4 counter
10/19/2013
V Q P U P Q V V P Q U U
CODE 0
CODE 1
CODE 2
CODE 3
V Q U P
U X 1 0 V 1 0 0
Q P V U
P V U P
P U Q V
Q Q V U TURN RIGHT NONE LEFT
U V P Q
CODE* CODE-1 CODE CODE+1
V P Q U V U
*Implement
as a modulo 4 counter
10/19/2013
10/19/2013
R0
R4
R1 R2 R3
10/19/2013 Introduction to Machine Vision
ALGORITHM: i=0 WHILE (Ri==0) { i++ } Move P to Ri Set i=6 for next search
10/19/2013
What are some examples of form parameters that would be useful in identifying the objects in the image below?
10/19/2013
10/19/2013
GENERALIZED MOMENTS
Shape features or form parameters provide a high level description of objects or regions in an image
Many shape features can be conveniently represented in terms of moments. The (p,q)th moment of a region R defined by the function f(x,y) is given by:
m pq x y f ( x, y)dxdy
p q R
10/19/2013
GENERALIZED MOMENTS
In the case of a digital image of size n by m pixels, this equation simplifies to:
M ij x y f ( x, y )
i j x 1 y 1
For binary images the function f(x,y) takes a value of 1 for pixels belonging to class object and 0 for class background.
10/19/2013 Introduction to Machine Vision
GENERALIZED MOMENTS
M ij x i y j f ( x, y )
x 1 y 1
X
0 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6
i 0 1 0
j 0 0 1
Mij 7
Area
33 20
159
2
0 1
Introduction to Machine Vision
0
2 1
64
93
Moment of Inertia
Y
10/19/2013
M 10 X M 00
M 01 Y M 00
10/19/2013
M 02
M M 02 M 00
2 01
M 20
M M 20 M 00
2 10
M 10 M 01 M 11 M 11 M 00
10/19/2013 Introduction to Machine Vision
2 M 11 TAN 2 M 20 M 02
10/19/2013 Introduction to Machine Vision
Example
X
Principal Axis
Center of Mass
Y
10/19/2013 Introduction to Machine Vision
I MIN
( M 02 M 20 ) 4M M 02 M 20 2 2
2
2 11
I MAX
( M 02 M 20 ) 4M M 02 M 20 2 2
2
2 11
10/19/2013
1 M 20 M 02
2 (M 20 M 02 ) 4M
2
10/19/2013 Introduction to Machine Vision
2 11
1
M
2 00
2
M
4 00
10/19/2013
The process is analogous to using a planimeter to graphically evaluate the area of a geometric figure.
10/19/2013 Introduction to Machine Vision
10/19/2013
case 2:
m00 = m00 + y; m01 = m01 + sum_y; m02 = m02 + sum_y2; m11 = m11 + (x*sum_y); sum_x = sum_x + x; sum_x2 = sum_x2 + x*x; x = x + 1; break;
case 3:
y = y - 1; sum_y = sum_y - y; sum_y2 = sum_y2 - y*y; m10 = m10 + sum_x; m20 = m20 + sum_x2; break; } }
10/19/2013
QUESTIONS
10/19/2013