Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to...
-
Upload
marion-malone -
Category
Documents
-
view
215 -
download
2
Transcript of Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to...
![Page 1: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/1.jpg)
Edges and Contours– Chapter 7
![Page 2: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/2.jpg)
Visual perception
• We don’t need to see all the color detail to recognize the scene content of an image
• That is, some data provides critical information for recognition, other data provides information that just makes things look “good”
![Page 3: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/3.jpg)
Visual perception
• Sometimes we see things that are not really there!!!
Kanizsa Triangle (and variants)
![Page 4: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/4.jpg)
Edges
• Edges (single points) and contours (chains of edges) play a dominant role in (various) biological vision systems– Edges are spatial positions in the image where the
intensity changes along some orientation (direction)
– The larger the change in intensity, the stronger the edge
– Basis of edge detection is the first derivative of the image intensity “function”
![Page 5: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/5.jpg)
First derivative – continuous f(x)• Slope of the line at a point tangent to
the function
)()(' xdx
dfxf
![Page 6: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/6.jpg)
First derivative – discrete f(u)• Slope of the line joining two adjacent (to the selected
point) point
2
)1()1()('
ufufuf
u-1 u+1u
![Page 7: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/7.jpg)
Discrete edge detection• Formulated as two partial derivatives
– Horizontal gradients yield vertical edges
– Vertical gradients yield horizontal edges
– Upon detection we can learn the magnitude (strength) and orientation of the edge
• More in a minute…
),( vuu
I
),( vuv
I
![Page 8: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/8.jpg)
NOTE
• In the following images, only the positive magnitude edges are shown
• This is an artifact of ImageJ
Process->Filters->Convolve… command
• Implemented as an edge operator, the code would have to compensate for this
![Page 9: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/9.jpg)
Detecting edges – sharp image
Image VerticalEdges
5.00.05.0
HorizontalEdges
5.0
0.0
5.0
![Page 10: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/10.jpg)
Detecting edges – blurry image
Image VerticalEdges
5.00.05.0
HorizontalEdges
5.0
0.0
5.0
![Page 11: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/11.jpg)
The problem…• Localized (small neighborhood)
detectors are susceptible to noise
![Page 12: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/12.jpg)
The solution
• Extend the neighborhood covered by the filter– Make the filter 2 dimensional
• Perform a smoothing step prior to the derivative– Since the operators are linear filters, we
can combine the smoothing and derivative operations into a single convolution
![Page 13: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/13.jpg)
Edge operator
• The following edge operators produce two results– A “magnitude” edge map (image)
– An “orientation” edge map (image)
),(),(22
),( vuDvuD yxvuE
),(
),(),( tan
1
vu
vuvu
DD
x
y
![Page 14: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/14.jpg)
Prewitt operator
• 3x3 neighborhood
• Equivalent to averaging followed by derivative– Note that these are convolutions, not matrix multiplications
101
101
101
HP
x
111
000
111
HP
y
101
1
1
1
H
P
y
1
0
1
111HP
y
![Page 15: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/15.jpg)
Prewitt – sharp image
![Page 16: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/16.jpg)
Prewitt – blurry image
![Page 17: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/17.jpg)
Prewitt – noisy image
• Clearly this is not a good solution…what went wrong?– The smoothing just smeared out the noise
• How could you fix it?– Perform non-linear noise removal first
![Page 18: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/18.jpg)
Prewitt magnitude and direction
![Page 19: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/19.jpg)
Prewitt magnitude and direction
![Page 20: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/20.jpg)
Sobel operator
• 3x3 neighborhood
• Equivalent to averaging followed by derivative– Note that these are convolutions, not matrix multiplications
– Same as Prewitt but the center row/column is weighted heavier
101
202
101
HP
x
121
000
121
HP
y
101
1
2
1
H
P
y
1
0
1
121HP
y
![Page 21: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/21.jpg)
Sobel – sharp image
![Page 22: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/22.jpg)
Sobel – blurry image
![Page 23: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/23.jpg)
Sobel – noisy image
• Clearly this is not a good solution…what went wrong?– The smoothing just smeared out the noise
• How could you fix it?– Perform non-linear noise removal first
![Page 24: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/24.jpg)
Sobel magnitude and direction
![Page 25: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/25.jpg)
Sobel magnitude and direction
![Page 26: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/26.jpg)
Sobel magnitude and direction
• Still not good…how could we fix this now? • Using the information of the direction (lots of randomly oriented,
non-homogeneous directions) can help to eliminate edged due to noise
– This is a “higher level” (intelligent) function
![Page 27: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/27.jpg)
Roberts operator
• Looks for diagonal gradients rather than horizontal/vertical
• Everything else is similar to Prewitt and Sobel operators
01
101HR
10
012HR
![Page 28: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/28.jpg)
Roberts magnitude and direction
![Page 29: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/29.jpg)
Roberts magnitude and direction
![Page 30: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/30.jpg)
Roberts magnitude and direction
![Page 31: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/31.jpg)
Compass operators
• An alternative to computing edge orientation as an estimate derived from two oriented filters (horizontal and vertical)
• Compass operators employ multiple oriented filters
• To most famous are– Kirsch – Nevatia-Babu
![Page 32: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/32.jpg)
Kirsch Filter
• Eight 3x3 kernel– Theoretically must perform eight convolutions– Realistically, only compute four convolutions, the other four
are merely sign changes
• The kernel that produces the maximum response is deemed the winner– Choose its magnitude– Choose its direction
![Page 33: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/33.jpg)
Kirsch filter kernels
101
202
101
101
202
101
Vertical edges
210
101
012
210
101
012
L-R diagonal edges
012
101
210
012
101
210
R-L diagonal edges
121
000
121
121
000
121
Horizontal edges
![Page 34: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/34.jpg)
Kirsch filter
![Page 35: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/35.jpg)
Nevatia-Babu Filter
• Twelve 5x5 kernel– Theoretically must perform twelve convolutions– Increments of approximately 30°– Realistically, only compute six convolutions, the
other six are merely sign changes
• The kernel that produces the maximum response is deemed the winner– Choose its magnitude– Choose its direction
![Page 36: Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649db05503460f94a9ebe3/html5/thumbnails/36.jpg)
Nevatia-Babu filter