Title: COMPUTER VISION
1COMPUTER VISION
- Visually Guided Autonomous Robot Navigation
- By
- Punarjay Chakravarty (AUSCC 2003)
2(No Transcript)
3GOAL Autonomous Detection of Objects in
Cyclops Field of View
4Vision
- Problem Convert real world 3-D information into
one that computer can understand. - Spectra
- Visible
- IR
- Ultrasound
- Laser Ranging
- Concentrate on visible.
5Converting 3-D object to 2-D info
- Colour image of object formed on cameras focal
plane. - Convert colour image to grayscale.
- Convert grayscale image to binary (ones and
zeros). - 3-D object described by 2-D array much easier
to handle perform Mathematical operations on
it.
6Binary Images
- How to convert grayscale image to binary image?
- Use Edge Detection
- Basic Idea Region of sharp increase in
intensity of grayscale image is an edge.
7Edge Detection
- Gradient has large peak centred around edge.
- Detect edge wherever gradient exceeds
pre-definded threshold.
8Colour -gt Grayscale -gt Binary
9Binary Correlation
- Mathematical process for identifying region in
image that looks most like given reference
sub-image (template).
10Binary Correlation
- Template overlaid on image at many different
locations. - At each location, goodness of match evaluated.
- Location with best match is the location of
object in image. - Matching at each location involves logical
AND-ing of template with image. - Resulting Pixel 1, if pixels in image and
template are both one.
11Binary Correlation
- Image M x N, Template m x n.
- No. of Translations (M-m1)(N-n1)
- For 352 x 288 image, 97 x 106 template 46,848
translations. - Matlab takes 469 seconds ! (0.01 sec per block
AND operation on 733 MHz machine)
12Need to smoothen the edges
- Methods like correlation that use edge-pixels
directly sensitive to noise. - Solution smoothen the edges of the edge-image.
- Use the DISTANCE TRANSFORM
13Distance Transform
- Operator normally only applied to binary images.
- Input Binary edge image.
- Output Grayscale image with graylevel intensity
of each pixel that is set to off in the edge
image changed to show the distance to its closest
edge (on) pixel. - Distance Euclidean/approximation to Euclidean
14Distance Transform
- DTs are global transformations.
- Reduce computational complexity consider
edge-pixels in immediate neighbourhood of edge
pixels (local transform). - DT at a pixel can be deduced from the values at
its neighbors.
15DT Algorithm
- Start with zero-infinity image set each edge
pixel to 0 and each non-edge pixel to infinity. - Make 2 passes over the image with a mask
- 1. Forward, from left to right and top to bottom
- 2. Backward, from right to left and from bottom
to top.
Backward Mask
Forward Mask
d1 and d2, are added to the pixel values in the
distance map and the new value of the zero pixel
is the minimum of the five sums.
16DT Algorithm
- For each position of mask on image,
- Vi,j minimum(vi-1,j-1d2,vi-1,j
d1,vi-,j1d2, - vi,j-1d1,vi,j)
17Matching Meausures
- Smoothed edge image obtained.
- Matching measures between image and model
- 1. Chamfer Distance.
- 2. Hausdorff Distance.
- 3. Simplified Hausdorff Distance
- (DT Binary Correlation).
18Chamfer Matching
- Edge-model translated over Distance Image.
- At each tranlsation, edge model superimposed on
distance image. - Average of distance values that edge model hits
gives Chamfer Distance. - Perfect fit between Edge model and Distance Image
will give Chamfer Distance of zero. - Root mean square Chamfer Distance chosen
- Chamfer Distance
- n
- 1/3(v(S vi2)/n)
- i1
- Vi distance value, n number of points
Chamfer Distance 1.12
19Hausdorff Distance
- Given two sets of points and
- the Hausdorff Distance is defined as
- where
- is any metric between the points
a and b. - For simplicity,
- which is the Euclidian distance between a(x1,y1)
and b(x2,y2)
20Forward Hausdorff Distance
- Forward Hausdorff Distance
- The Forward Hausdorff distance, h(A,B), measures
the degree of mismatch between two sets, as it
reflects the distance of the point of A that is
farthest from any point of B. - Intuitively If h(A,B) d, then every point of
A must be within distance d of some point of B.
21Forward Hausdorff example
- Consider the point sets Aa1,a2,a3 and
Bb1,b2,b3. - 1.Find a point in A thats the farthest away from
any point in B. - 2. h(A,B) is the distance from this point to
the closest point in B.
22Forward Hausdorff example
- a2 is the point of A that is farthest away from
any point in B (b2).
23Forward Hausdorff example
- d is the distance from a2 to the closest point in
B (b3). - This is the Forward Hausdorff Distance between
point sets A and B.
24Forward Hausdorff for 2 similar point sets
- For 2 similar point sets that are correctly
aligned, h(A,B) becomes small.
25Searching for object in image
26Translation of object over image
27h(A,B) will be minimum when model is perfectly
aligned with object in image
28Brute force algorithm to compute h(A,B)
- 1. h 0
- 2. for every point ai of A,
- 2.1 shortest Inf
- 2.2 for every point bj of B
- dij ai bj
- If dij lt shortest then shortest dij
- 2.3 If shortest gt h then h shortest
29Forward Hausdorff Distance in terms of set
containment
- Let ,where is a disk
of radius d and is the Minkowski sum. - (For two point sets P and Q,
- )
-
- By definition if and only if
, - because in order for every point of A to be
within distance d of B it must be contained in
B. - B is also called the dilated version of B.
- B has been dilated by d
-
30Dilation of B by d to get B.
- Intuitively, B' is the set obtained by replacing
each point of B with a disk of radius d, and
taking the union of all of these disks.
31Identify model M in image I
- Use the Hausdorff distance to identify instances
of some model M in some image I. - Seek translation for which h(I, Mt) lt d
- Method Dilation by d and correlation.
32Simpified Hausdorff Dilation and Correlation
- Dilate the image I by d to get
- Then compute the correlation of Mt with I (the
logical and of Mt and I). - For each translation t of M w.r.t I, the
correlation determines p the number of points of
Mt superimposed with I.
33Distance Transform as a method to compute dilated
images
- To search for the object in the image, we search
for a minimum radius d that the image set I must
be dilated with to cover k/m points of the model
set M. (k/m threshold fraction) - Could involve many dilations of image I, which is
computationally quite expensive. - Solution Distance Transform the image and then
threshold it by different amounts to form
different dilated image sets.
34Image pre-processing
Original Image
Edge Image
Dilation (d 4)
DT Image
35Different dilations
Dilation (d 8)
Dilation (d 20)
DT only needs to be computed once. dilation by
any factor available from this!
36Image and Object Template
37Our Algorithm
- Off-line Create a database of edge detected
object-images. - On-line
- Capture a snapshot of what the robot is seeing.
- Perform edge-detection and the Distance Transform
on it, and threshold-ing to get a dilated edge
detected picture of what the robot is seeing. - Translate and position the model at various
positions of the image, and calculate the Forward
Hausdorff measure for each position of the model
over the image. - The best match Translation with the maximum
Hausdorff measure.
38ALGORITHM
39Summary
- Target recognition
- Colour -gt Grayscale -gt Edge Image (binary).
- Perform Distance Transform on binary image.
- Match image with model using similarity measure
- Chamfer Distance
- Hausdorff Distance.
40Olympus Mons, Mars 2012 A.D.
41References
- www-cgrl.cs.mcgill.ca (Hausdorff Distance)
- www.cs.cornell.edu (Hausdorff Distance)
- www.tele.ucl.ac.be (Chamfer Distance)
- www.gavrila.net (Chamfer Distance)
- www-ece.rice.edu (Edge Detection)