Objective%20of%20Computer%20Vision - PowerPoint PPT Presentation

About This Presentation
Title:

Objective%20of%20Computer%20Vision

Description:

By the least-squares fit of the line, Step 1: calculate a,b,c coefficients ... By the least-squares fit of the line, Calculate center. Calculate a, b, and c. ... – PowerPoint PPT presentation

Number of Views:166
Avg rating:3.0/5.0
Slides: 68
Provided by: webCe
Learn more at: http://web.cecs.pdx.edu
Category:

less

Transcript and Presenter's Notes

Title: Objective%20of%20Computer%20Vision


1
Objective of Computer Vision
  • The field of computer vision can be divided
    into two areas
  • Image enhancement
  • Image analysis

Here we concentrate on fast methods typical for
robot soccer and robot theatre applications
2
Binary image processing
  • Image with two gray levels 0 and 1
  • It contains the basic terms and concepts used in
    machine vision.
  • Its techniques are used in all aspects of a
    vision system.
  • Small memory requirements
  • Fast execution time

3
(No Transcript)
4
(No Transcript)
5
  • Gray level image vs. binary image

6
Image Enhancement
7
Point Operations
8
(No Transcript)
9
Region and segmentation
  • Region ( )
  • A subset of an image
  • Segmentation
  • Grouping of pixels into regions such that

10
Thresholding
11
Thresholding
  • Thresholding
  • A method to convert a gray scale image into a
    binary image for object-background separation
  • Thresholded gray image
  • Obtained using a threshold T for the original
    gray image
  • .
  • Binary image
  • Equivalent to .

12
  • Three types of thresholding
  • where Z is a set of which elements are
    integer-valued intervals.

13
  • Original image and its histogram

14
  • Thresholding

15
Histogram Equalization
H
16
(No Transcript)
17
  • Vision Systemof Soccer Robot

18
Image notation for soccer
  • Image a two-dimensional array of pixels

Pixel ai, j
19
Geometric properties
  • In many cases, some simple features of regions
    are useful to
  • determine the locations of objects,
  • and to recognize objects.
  • Geometric properties
  • Size
  • Position
  • Orientation

20
Size and position
  • Given an m x n binary image,
  • Size (area) A zero-order moment
  • Position the center of area

Total size is number of black dots
Average in x
Average in y
21
Example
22
How to calculate line orientation?
Step 1 calculate a,b,c coefficients
  • The center of object
  • Let
  • By the least-squares fit of the line,

Step 2 calculate angle, line orientation
23
Size filter for Noise removal
  • It can effectively remove noise after component
    algorithm labeling.
  • If objects of interest have sizes greater than T,
    all components below T are removed by changing
    the corresponding pixels values to 0.

A noisy binary image and the resulting image
after size filtering (T 10)
24
How to get the position and angle of robot
  • Get frame-grabber, color CCD camera and computer.
  • Understand how you can read the image data from
    frame-grabber.
  • Find the position of a colored object in 2-D
    image.
  • Determine the robot uniform with two colored
    objects
  • Calculate the position and angle of the robot
    from the positions of two colored objects.

25
Position of colored object
  • 1. Setting of ranges for YUV
  • Ymin,Ymax, Umin,Umax, Vmin, Vmax
  • 2. Thresholding
  • 3. Labeling (grouping)
  • 4. Size filtering (noise elimination)
  • 5. Finding the center of a colored object

26
Calculations for soccer field
27
Finding robots in the field
28
Robot position and heading
This cross sign is easy to recognize
29
Robot color and team color
This slide explains labeling robots and teams
30
Window tracking method
  • Processing only the data within a small window
  • Getting a fast vision processing

31
Line Orientation
  • Orientation from of the axis of elongation

This is called line orientation
32
  • Line equation
  • the minimum distance between the line and
    origin
  • the angle from x-axis to the line
  • The distance, d, from any (x, y) within the
    object to the line
  • which satisfies
  • Minimize

Our task is to find values of angle theta and rho
for which this formula is minimum. This provides
best fit to line equation
33
Given is object. Find its line orientation
  • The center of object
  • Let
  1. Calculate center
  2. Calculate a, b, and c.

34
  • By the least-squares fit of the line,
  1. Calculate center
  2. Calculate a, b, and c.
  3. Calculate theta

35
Binary algorithms
  • Several definitions
  • Neighbors
  • 4-neighbors (4-connected)
  • 8-neighbors (8-connected)

36
  • Path
  • A sequence of neighbors
  • Foreground
  • The set of all unity valued pixels in an image
  • Connectivity
  • A pixel is said to be connected to
    if there is a path from to
    consisting entirely of pixels of .
  • Connected components
  • A set of pixels in which each pixel is connected
    to all other pixels.

37
Component labeling
  • Component labeling algorithm
  • It finds all connected components in an image and
    assigns a unique label to all the points in a
    component.
  • One of the most common operations in machine
    vision
  • Recursive connected components algorithm
  • Sequential connected components algorithm
  • The points in a connected component form a
    candidate region for an object.

38
  • An image and its connected component image

39
Recursive algorithm for connected component
labeling
  • Recursive connected components algorithm
  • Scan the image to find an unlabeled unity valued
    pixel and assign it a new label L.
  • 2. Recursively assign a label L to all its unity
    valued neighbors.
  • 3. Stop if there are no more unlabeled unity
    valued pixels.
  • 4. Go to step 1.

40
  • Pseudo code for the recursive algorithm

41
Sequential algorithm for connected component
labeling
  • Sequential connected components algorithm using
    4-connectivity
  • Scan the image from left to right and top to
    bottom.
  • 2. If the pixel is unity valued , then
  • If only one of its upper or left neighbors has a
    label, then copy the label.
  • (b) If both have the same label, then copy the
    same label.
  • (c) If both have different labels, then copy the
    upper pixels label and enter the labels in an
    equivalence table as equivalent labels.

42
Sequential algorithm for connected component
labeling continued
  • (d) Otherwise assign a new label to this pixel
    and enter this label in the equivalence table.
  • 3. If there are more pixels to consider, then go
    to step 2.
  • 4. Find the lowest label for each equivalent
    set in the
  • equivalence table.
  • 5. Scan the picture. Replace each label by the
    lowest label in its equivalent set.

43
  • Pseudo code for step 2 in the sequential algorithm

44
  • An example for the sequential algorithm

45
Digital Geometry
j
I(i,j)
(0,0)
Picture Element or Pixel
i
32
  • Neighborhood
  • Connectedness
  • Distance Metrics

0,1 Binary Image 0 - K-1 Gray Scale Image Vector
Multispectral Image
46
Connected Components
  • Binary image with multiple 'objects'
  • Separate 'objects' must be labeled individually

6 Connected Components
47
Finding Connected Components
  • Two points in an image are 'connected' if a path
    can be found for which the value of the image
    function is the same all along the path.

48
Algorithm
  • Pick any pixel in the image and assign it a label
  • Assign same label to any neighbor pixel with the
    same value of the image function
  • Continue labeling neighbors until no neighbors
    can be assigned this label
  • Choose another label and another pixel not
    already labeled and continue
  • If no more unlabeled image points, stop.

Who's my neighbor?
49
Example
50
Neighbor
  • Consider the definition of the term 'neighbor'
  • Two common definitions

Four Neighbor
Eight Neighbor
  • Consider what happens with a closed curve.
  • One would expect a closed curve to partition the
    plane into two connected regions.

51
Alternate Neighborhood Definitions
52
Possible Solutions
  • Use 4-neighborhood for object and 8-neighborhood
    for background
  • requires a-priori knowledge about which pixels
    are object and which are background
  • Use a six-connected neighborhood

53
Digital Distances
  • Alternate distance metrics for digital images

Euclidean Distance
City Block Distance
Chessboard Distance
max i-n, j-m
i-n j-m
(i-n) 2 (j-m) 2
54
Connected Components /Image Labeling
  • Goal To find clusters of pixels that are similar
    and connected to each other
  • How it works
  • Assign a value to each pixel
  • Define what similar values mean
  • e.g., 10 /- 2
  • Determine if like pixels are connected

55
Connected Components /Image Labeling
4- connected
56
Component Labeling
  • Definitions
  • Neighbors
  • 4-neighbors (4-connected)
  • 8-neighbors (8-connected)
  • Connected components
  • A set of pixels in which each pixel is connected
    to all other pixels.

57
An image and its connected component image
58
Connected Components /Image Labeling
A
A
A
A
A
A
A
B
B
A
A
A
A
A
A
C
A
A
A
D
D
C
C
A
A
D
D
C
C
A
59
Connected Components /Image Labeling
A
A
A
A
A
A
A
B
B
A
A
A
A
A
A
B
A
A
A
C
C
B
B
A
A
C
C
B
B
A
60
Binary Image Processing
After thresholding an image, we want to know
something about the regions found ...
How many objects are in the image? Where are
the distinct object components? Cleaning up
a binary image? Recognizing objects through
their response to image masks Describing the
shape/structure of 2d objects Pattern
61
Counting Objects
external corners
internal corners
62
Connected Component Labeling
0
1
0
1
2
63
Connected Component Labeling
Algorithm
0
1
1. Image is A. Let A -A 2. Start in upper
left and work L to R, Top to Bottom, looking for
an unprocessed (-1) pixel. 3. When one is found,
change its label to the next unused integer.
Relabel all of that pixels unprocessed neighbors
and their neighbors recursively. 4. When there
are no more unprocessed neighbors, resume
searching at step 2 -- but do so where you left
off the last time.
0
1
2
64
Summary
  • A simple procedure to get robot position and
    heading
  • Thresholding,
  • labeling,
  • size filtering,
  • center of area calculation,
  • window tracking method
  • Trade-off between
  • real-time vision processing
  • and robustness
  • Specific frame grabber required

65
Problems for students
  1. Binary image processing and basic operations on
    binary images.
  2. List and explain briefly operations used in image
    enhancement
  3. What are point operations. Give examples.
  4. Explain contrast stretching operation. Write
    simple program.
  5. Definition of image segmentation.
  6. Segmentation based on thresholding
  7. Types of thresholding. Give examples of each with
    practical applications.
  8. The general idea of histogram equalization. Show
    examples.
  9. Geometric positions of objects in robot soccer.
  10. Size and position of objects in robot soccer.

66
Problems for students
  • 11. How to calculate quickly the center of the
    mass of an object?
  • 12. How to calculate line orientation?
  • 13. Describe and program size filter for noise
    removal. Emphasize speed not quality.
  • 14. How to calculate position and angle of a
    robot using the ceiling camera?
  • 15. Use of colors in vision of robot soccer.
  • 16. Window tracking methods in robot soccer.
  • 17. Use of Line orientation in robot soccer.

67
Problems for students
  1. Binary image processing algorithms in robot
    soccer.
  2. Component labeling
  3. Recursive connected components algorithm
  4. Sequential connected components algorithm
  5. Algorithms to find connected components.
  6. Alternate definitions of neighbors in connected
    components algorithms. Applications in robot
    soccer.
  7. The concept of digital distance and its use.
  8. Connected component labeling in binary images.
  9. Counting objects. What are applications in robot
    soccer?
Write a Comment
User Comments (0)
About PowerShow.com