Carlo Tomasi, Computer Science. Human Vision Computer Vision?
Low level Computer Vision
description
Transcript of Low level Computer Vision
![Page 1: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/1.jpg)
Low level Computer Vision1. Thresholding
2. Convolution
3. Morphological Operations
4. Connected Component Extraction
5. Feature Extraction
1
![Page 2: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/2.jpg)
3. Mathematical Morphology Morphology: Study of forms of animals
and plants Mathematical Morphology: Study of
shapes Similar to convolution Arithmetic operations Set Operations
2
![Page 3: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/3.jpg)
Need to define Image as a Set Given a binary image I (r,c), assume 1
correspond to object 0 correspond to backround. Define a set with elements to the coordinates of the object
X = { (r1,c1), (r2,c2),….}
3
![Page 4: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/4.jpg)
Set OperationsSet Operations
![Page 5: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/5.jpg)
Set Operations on ImagesSet Operations on ImagesAND, ORAND, OR
Set Operations on ImagesSet Operations on ImagesAND, ORAND, OR
![Page 6: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/6.jpg)
TRANSLATION REFLECTIONTRANSLATION REFLECTIONTRANSLATION REFLECTIONTRANSLATION REFLECTION
![Page 7: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/7.jpg)
Set OperationsSet Operations
![Page 8: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/8.jpg)
Morphologic Operations
8
Binary mathematical morphology consists of twobasic operations
dilation and erosion
and several composite relations
closing and opening
![Page 9: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/9.jpg)
Dilation:
9
Dilation expands the connected sets of 1s of a binary image.
It can be used for
1. growing features
2. filling holes and gaps
![Page 10: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/10.jpg)
Structuring Elements
10
A structuring element is a shape mask used inthe basic morphological operations.
They can be any shape and size that isdigitally representable, and each has an origin.
boxhexagon disk
something
box(length,width) disk(diameter)
![Page 11: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/11.jpg)
Dilation with Structuring Element S:B+S ={ Z: (Sz)∩ B≠ Φ}
11
The arguments to dilation and erosion are
1. a binary image B2. a structuring element S
dilate(B,S) takes binary image B, places the originof structuring element S over each 1-pixel, and ORsthe structuring element S into the output image atthe corresponding position.
0 0 0 00 1 1 00 0 0 0
11 1
0 1 1 00 1 1 10 0 0 0
originBS
dilate
B S
![Page 12: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/12.jpg)
DILATIONDILATION
![Page 13: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/13.jpg)
DILATIONDILATION
![Page 14: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/14.jpg)
Erosion B-S ={ Z: (Sz) B}
14
Erosion shrinks the connected sets of 1s of a binary image.
It can be used for
1. shrinking features
2. Removing bridges, branches and small protrusions
![Page 15: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/15.jpg)
Erosion with Structuring Elements
15
erode(B,S) takes a binary image B, places the origin of structuring element S over every pixel position, andORs a binary 1 into that position of the output image only ifevery position of S (with a 1) covers a 1 in B.
0 0 1 1 00 0 1 1 00 0 1 1 01 1 1 1 1
111
0 0 0 0 00 0 1 1 00 0 1 1 00 0 0 0 0
B S
origin
erode
B S
![Page 16: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/16.jpg)
EROSİON:EROSİON:
![Page 17: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/17.jpg)
IMAGE ENHANCEMENT WİTH MORPHOLOGYIMAGE ENHANCEMENT WİTH MORPHOLOGY
![Page 18: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/18.jpg)
Example to Try
18
0 0 1 0 0 1 0 0 0 0 1 1 1 1 1 0 1 1 1 1 1 1 0 01 1 1 1 1 1 1 10 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0
1 1 11 1 11 1 1
erode
dilate with same structuring element
SB
![Page 19: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/19.jpg)
Opening and Closing
19
• Closing is the compound operation of dilation followed by erosion (with the same structuring element)
• Opening is the compound operation of erosion followed by dilation (with the same structuring element)
![Page 20: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/20.jpg)
Use of Opening
20
Original Opening Corners
1. What kind of structuring element was used in the opening?
2. How did we get the corners?
![Page 21: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/21.jpg)
OPENİNG AND CLOSİNGOPENİNG AND CLOSİNGOPENİNG AND CLOSİNGOPENİNG AND CLOSİNG
![Page 22: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/22.jpg)
FINGERPRİNT RECOGNİTİONFINGERPRİNT RECOGNİTİON
![Page 23: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/23.jpg)
HOW DO YOU REMOVE THE HOLESHole: A closed backround region surrounded by object pixels
HOW DO YOU REMOVE THE HOLESHole: A closed backround region surrounded by object pixels
![Page 24: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/24.jpg)
Morphological Analysis for Bone detectionMorphological Analysis for Bone detection
![Page 25: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/25.jpg)
OBJECT DETECTIONOBJECT DETECTION
![Page 26: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/26.jpg)
BOUNDARY EXTRACTİONBoundary: A set of one-pixel-wide
connected pixels which has at least one neighbor outside the object
BOUNDARY EXTRACTİONBoundary: A set of one-pixel-wide
connected pixels which has at least one neighbor outside the object
![Page 27: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/27.jpg)
BOUNDARY EXTRACTİONBOUNDARY EXTRACTİON
![Page 28: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/28.jpg)
Skeleton finding:Skeleton: Set of one-pixel wide connected pixels which
are at equal distance from at least two boundary pixels
Skeleton finding:Skeleton: Set of one-pixel wide connected pixels which
are at equal distance from at least two boundary pixels
![Page 29: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/29.jpg)
Morphological Image ProcessingMorphological Image Processing
![Page 30: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/30.jpg)
Morphological Image ProcessingMorphological Image Processing
![Page 31: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/31.jpg)
![Page 32: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/32.jpg)
Morphological OperationsMorphological Operations
![Page 33: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/33.jpg)
Morphological OperationsMorphological Operations
![Page 34: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/34.jpg)
Gear Tooth Inspection
34
originalbinary image
detecteddefects
How didthey do it?
![Page 35: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/35.jpg)
Some Details
35
![Page 36: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/36.jpg)
Region Properties-Features
36
Properties of the regions can be used to recognize objects.
• geometric properties (Ch 3)
• gray-tone properties
• color properties
• texture properties
• shape properties (a few in Ch 3)
• motion properties
• relationship properties (1 in Ch 3)
![Page 37: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/37.jpg)
Geometric and Shape Properties
37
• area:
• centroid:
• perimeter :
• perimeter length:
• circularity:
• elongation• mean and standard deviation of radial distance• bounding box• extremal axis length from bounding box• second order moments (row, column, mixed)• lengths and orientations of axes of best-fit ellipse
![Page 38: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/38.jpg)
4. Connected Components Labeling
38
Once you have a binary image, you can identify and then analyze each connected set of pixels.
The connected components operation takes in a binary image and produces a labeled image in which each pixel has the integer label of either the background (0) or a component.
binary image after morphology connected components
![Page 39: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/39.jpg)
Methods for CC Analysis
39
1. Recursive Tracking (almost never used)
2. Parallel Growing (needs parallel hardware)
3. Row-by-Row (most common)
• Classical Algorithm (see text)
• Efficient Run-Length Algorithm (developed for speed in real industrial applications)
![Page 40: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/40.jpg)
Equivalent Labels
40
0 0 0 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 10 0 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 10 0 0 1 1 1 1 1 0 0 1 1 1 1 0 0 1 1 10 0 0 1 1 1 1 1 1 0 1 1 1 1 0 0 1 1 10 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 10 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 10 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 10 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 10 0 0 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1
Original Binary Image
![Page 41: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/41.jpg)
Equivalent Labels
41
0 0 0 1 1 1 0 0 0 0 2 2 2 2 0 0 0 0 30 0 0 1 1 1 1 0 0 0 2 2 2 2 0 0 0 3 30 0 0 1 1 1 1 1 0 0 2 2 2 2 0 0 3 3 30 0 0 1 1 1 1 1 1 0 2 2 2 2 0 0 3 3 30 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 3 3 30 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 3 3 30 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 10 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 10 0 0 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1
The Labeling Process
1 21 3
![Page 42: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/42.jpg)
Run-Length Data Structure
42
1 1 1 11 1 11 1 1 1
1 1 1 1
0 1 2 3 401234
U N U S E D 00 0 1 00 3 4 01 0 1 01 4 4 02 0 2 02 4 4 04 1 4 0
row scol ecol label
01234567
Rstart Rend
1 23 45 60 07 7
01234 Runs
Row Index
BinaryImage
![Page 43: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/43.jpg)
Run-Length Algorithm
43
Procedure run_length_classical { initialize Run-Length and Union-Find data structures count <- 0
/* Pass 1 (by rows) */
for each current row and its previous row { move pointer P along the runs of current row move pointer Q along the runs of previous row
![Page 44: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/44.jpg)
Case 1: No Overlap
44
|/////| |/////| |////|
|///| |///| |/////|
Q
P
Q
P
/* new label */ count <- count + 1 label(P) <- count P <- P + 1
/* check Q’s next run */Q <- Q + 1
![Page 45: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/45.jpg)
Case 2: Overlap
45
Subcase 1: P’s run has no label yet
|///////| |/////| |/////////////|
Subcase 2:P’s run has a label that isdifferent from Q’s run
|///////| |/////| |/////////////|
P P
label(P) <- label(Q)move pointer(s)
union(label(P),label(Q))move pointer(s)
}
![Page 46: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/46.jpg)
Pass 2 (by runs)
46
/* Relabel each run with the name of the equivalence class of its label */For each run M { label(M) <- find(label(M)) }
}
where union and find refer to the operations of theUnion-Find data structure, which keeps track of setsof equivalent labels.
![Page 47: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/47.jpg)
Labeling shown as Pseudo-Color
47
connectedcomponentsof 1’s fromthresholdedimage
connectedcomponentsof clusterlabels
![Page 48: Low level Computer Vision](https://reader036.fdocuments.net/reader036/viewer/2022062301/56813949550346895da0e6e1/html5/thumbnails/48.jpg)
Region Adjacency Graph
48
A region adjacency graph (RAG) is a graph in whicheach node represents a region of the image and an edgeconnects two nodes if the regions are adjacent.
1
2
34
1 2
34