Presentation is loading. Please wait.

Presentation is loading. Please wait.

Machine Vision for Robots

Similar presentations


Presentation on theme: "Machine Vision for Robots"— Presentation transcript:

1 Machine Vision for Robots
Modeling Cameras Processing Images Geometric/Moment based Features Other Features

2 Histograms and Thresholding
Histogram: graphical presentation of the frequency count of the occurrence of each intensity in an image Magnitude of histogram at a specific pixel value, hist(g), is the probability of the gray value, g, occurring in any picture element in the frame

3 Histograms and Thresholding
determine if image has sufficient contrast equalize image histograms to perform operations (e.g. subtraction) determine appropriate threshold values

4 Histograms and Thresholding
Segmentation of the image (classify each pixel) according to gray value – I.e. for threshold, T Puts pixel into the set of background Sb or foreground Sf pixels binary segmentation of the image

5 Connect Component Analysis
Identify individual components (blobs) within the image: Input: a binary image with objects having value 1 and background having value 0. Output: an image with each region having value equal to the region label (and the background having value 0). 4-connected vs. 8-connected A is not connected to C in 4-connectivity A is connected to C in 8-connectivity A C D B

6 Connect Component Algorithm
One Algorithm (4-connectivity): Pass 1: If A==1 and D==1 then EqualLabels (A,D) If A==1 and B==1 then EqualLabels(A,B) If A==1 and Both(B==1) and (D==1) then If (Label(B) != Label(D) then EqualLabels(B,D) Pass 2: Relabel each pixel within each equivalence class A C D B In Matlab™ the routine bwlabel performs a connected component analysis

7 Geometric Properties Assume: binary image with ONE object having value 1 and background having value 0. Moment definition:

8 Geometric Properties Assume binary image with ONE object having value 1 and background having value 0. Moment definition: Note m00 is the area

9 Geometric Properties Center of mass: point such that if all the object’s mass were concentrated at that point, the first moments would not change

10 Geometric Properties Center of mass: point such that if all the object’s mass were concentrated at that point, the first moments would not change Note m00 is the area The zero and first moments give the centroid

11 Geometric Properties Centralized Moment definition:
Note m00 is still the area but the first centralized moments are now zero

12 Geometric Properties Orientation: axis that passes through the object such that the second moment of the object about that axis is minimal Or where = minimum distance from pixel (c,r) to the line To solve? Parameterize line with (r, q) Compute partial derivatives of w.r.t. (r, q) Find minima by setting partial derivatives to zero

13 Geometric Properties Line parameterization Now our task is to find:
Normal to line is Perpendicular distance from line to origin is Now our task is to find:

14 Geometric Properties Derivative Set to zero
Defines a line through centroid shift origin Line is now

15 Geometric Properties Derivative, set to zero Solve (algebra…)
Or, using double angle formulas

16 Geometric Properties Principal axes from second moments
Orientation of principal axis w.r.t. image x-axis Or using double angle formula we can also write:

17 Geometric Properties Alternate point of view Think ellipses again
Eigenvectors along major/minor axes Eigenvalues give length of major/minor axes

18 Geometric Properties Area, Centroid
Principal axes from second moments (centralized) Orientation Major/ Minor axis length

19 Geometric Properties Normalized moments Moment Invariants
Functions whose values are approximately constant under various transformations E.g. the zeroth moment does not change under rotation about the optical axis (i.e. rotation in the image plane)

20 Geometric Properties Moment Invariants

21 Image Features Measured quantities – can be used to “represent” the object Centroid Best fit ellipse (centroid + axes) Area Compactness Perimeter2/(4p Area) ¸ 1 Eccentricity (major axis length)/(minor axis length) Moment Invariants # Holes

22 Features & Patterns We can represent the features associated with an object as a vector area compactness Mi4 Mi5

23 Features & Patterns We can represent the features associated with an object as a vector A set of samples, described by their statistical properties with respect to a number of features defines a pattern.

24 Features & Patterns From a set of samples we can find the mean value of each feature The covariance is

25 Features & Patterns The covariance is

26 Features & Patterns The statistics (mean & covariance) can be used to classify an object. Given a set of samples for objects (O1,…,OM) we can compute for each object class For a new object, onew, we measure the features

27 Features & Patterns Pattern classification:
Which object (O1,…,OM) is this new object closest too? How do we measure distance? Euclidean:

28 Example: Euclidean Distance
Two features measured for two objects O1 O2 Feature 2 Feature 1

29 Example: Euclidean Distance
Compute statistics O1 O2 Feature 2 Feature 1

30 Example: Euclidean Distance
Compute statistics O1 O2 Feature 2 Feature 1

31 Example: Euclidean Distance
Measure features for new object O1 O2 Feature 2 Measured feature values for new object Feature 1

32 Example: Euclidean Distance
Compute distance O1 O2 Feature 2 Euclidean distance to mean of features for Objects 1 and 2 Feature 1

33 Example: Euclidean Distance
Statistically – which object is more likely? O1 O2 Feature 2 Feature 1

34 Features & Patterns Pattern classification:
How do we measure distance taking into account statistics? Inversely weight distance with variance Mahalanobis distance: Weights the distance by the inverse of the (co)variance

35 Example: Mahalanobis Distance
Two features measured for two objects O1 O2 Feature 2 Feature 1

36 Example: Mahalanobis Distance
Compute statistics O1 O2 Feature 2 Feature 1

37 Example: Mahalanobis Distance
Use statistics to measure disance O1 O2 Feature 2 Feature 1

38 Features & Patterns For M objects we need to store the mean of the feature vector and the covariance For a new object, onew, we measure the features and compute the distance to each object class (M distance computations) and find the minimum


Download ppt "Machine Vision for Robots"

Similar presentations


Ads by Google