edge detection summary - icarus.csd.auth.gr

31
Edge Detection summary S. Vartalami, Prof. Ioannis Pitas Aristotle University of Thessaloniki [email protected] www.aiia.csd.auth.gr Version 3.8.1

Upload: others

Post on 07-Jan-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Edge Detection summary - icarus.csd.auth.gr

Edge Detection

summaryS. Vartalami, Prof. Ioannis Pitas

Aristotle University of Thessaloniki

[email protected]

www.aiia.csd.auth.gr

Version 3.8.1

Page 2: Edge Detection summary - icarus.csd.auth.gr

Edge Detection Overview

β€’ Introduction

β€’ Edge detection

β€’ Edge thresholding

β€’ Hough transform

β€’ Edge following algorithms

β€’ Contour detection

β€’ Active Contours

β€’ Neural Edge detection

β€’ Neural Contour detection.

2

Page 3: Edge Detection summary - icarus.csd.auth.gr

An image edge can be considered as the border between two

homogeneous image regions having different illumination

intensities.

Edges are useful for:

β€’ image analysis, object recognition and

β€’ image filtering, image compression.

Introduction

3

Page 4: Edge Detection summary - icarus.csd.auth.gr

Edge types

Horizontal image edges

4

Page 5: Edge Detection summary - icarus.csd.auth.gr

Edge types

Vertical image edges

5

Page 6: Edge Detection summary - icarus.csd.auth.gr

Image intensity gradient:

βˆ‡π‘“(π‘₯, 𝑦) =Ξ”[πœ•π‘“

πœ•π‘₯

πœ•π‘“

πœ•π‘¦]𝑇 =

Ξ”[𝑓π‘₯ 𝑓𝑦]

𝑇 .

Gradient magnitude can be used as edge detector:

𝑒 π‘₯, 𝑦 = 𝑓π‘₯2 π‘₯, 𝑦 + 𝑓𝑦

2 π‘₯, 𝑦 .

Edge detection

6

Page 7: Edge Detection summary - icarus.csd.auth.gr

Gradient masks examples:

1 1 10 0 0βˆ’1 βˆ’1 βˆ’1

βˆ’1 0 1βˆ’1 0 1βˆ’1 0 1

1 2 10 0 0βˆ’1 βˆ’2 βˆ’1

βˆ’1 0 1βˆ’2 0 2βˆ’1 0 1

Prewitt edge detector masks. Sobel edge detector masks.

β€’ They can be used for horizontal (left) or vertical (right) edge

detection.

β€’ No or trivial (by 2) multiplications are involved.

Edge detection

7

Page 8: Edge Detection summary - icarus.csd.auth.gr

Edge detection

a) Lenna image; b) Sobel edge detector output ; c) horizontal edges; d) vertical edges.

8

Page 9: Edge Detection summary - icarus.csd.auth.gr

Edge detection

First and second order differentiation. Zero crossing.

9

Zero crossing

𝑦 = 𝑓(π‘₯)

y

y

y

y

y y

x

x

x

x

x

x

[DECETI]

Page 10: Edge Detection summary - icarus.csd.auth.gr

Edge detection

Negative LoG function [LOG].

10

Page 11: Edge Detection summary - icarus.csd.auth.gr

Edge detection

β€’ Local image range:

𝑀 π‘˜, 𝑙 = max𝐴

𝑓 π‘˜, 𝑙 βˆ’ min𝐴

𝑓 π‘˜, 𝑙

β€’ 𝐴: Local 𝑀 ×𝑀 image window.

11

Page 12: Edge Detection summary - icarus.csd.auth.gr

Canny edge detector

β€’ This is probably the most widely used edge detector in

computer vision.

β€’ Canny has shown that the first derivative of a Gaussian filter

kernel closely approximates the operator that optimizes the

product of signal-to-noise ratio and localization.

β€’ This analysis is based on step edges corrupted by additive

Gaussian noise.

12

Page 13: Edge Detection summary - icarus.csd.auth.gr

When the edge detector output is large, a local edge is

present. This can be found by thresholding:

𝐸 𝑖, 𝑗 = α‰Š1, if 𝑒 𝑖, 𝑗 β‰₯ 𝑇,0, otherwise.

β€’ Threshold 𝑇 can be chosen using edge detector output

histogram, so that it exceeds only a small percentage of

edge pixels.

β€’ Thresholding is global.

β€’ Edge detector output thresholding produces a binary image.

13

Edge thresholding

Page 14: Edge Detection summary - icarus.csd.auth.gr

Hough Transform uses a parametric description of simple

geometrical shapes (curves), in order to reduce the

computational complexity of the search space.

β€’ The parametric description a straight line is a linear equation:

𝑦 = π‘Žπ‘₯ + 𝑏.

14

Hough transform

a) Image plane; b) parameter space.

Page 15: Edge Detection summary - icarus.csd.auth.gr

15

Hough transform

Upper row: a) Original image; b) Hough polar parameter space;

Lower row: c) detected straight lines; d) lines overlaid on original image.

Page 16: Edge Detection summary - icarus.csd.auth.gr

Hough Transform in Byzantine iconography analysis.

16

Hough transform

Page 17: Edge Detection summary - icarus.csd.auth.gr

Boundary-following algorithms follow the local edge elements,

ensuring local edge continuity.

Edge continuity features:

β€’ 𝑒(𝐱) = 𝑒(π‘₯, 𝑦): edge magnitude at location 𝐱 = π‘₯, 𝑦 𝛡.

β€’ πœ‘(𝐱) = πœ‘(π‘₯, 𝑦): edge direction.

β€’ |𝑒(𝐱𝑖) βˆ’ 𝑒(𝐱𝑗)|: similarity measure for neighboring edge

magnitude.

β€’ |πœ‘(𝐱𝑖) βˆ’ πœ‘(𝐱𝑗)|: direction difference similarity measure.

Edge-following algorithms

17

Page 18: Edge Detection summary - icarus.csd.auth.gr

Heuristic contour following in subtractive angiography [Wikipedia].

18

Edge-following algorithms

Page 19: Edge Detection summary - icarus.csd.auth.gr

Edge following can be based on graph search:

β€’ Edge elements at position 𝐱𝑖 can be considered as graph

nodes.

β€’ The nodes are connected to each other, if local edge linking

rules are satisfied.

19

Edge-following algorithms

Page 20: Edge Detection summary - icarus.csd.auth.gr

I.Pitas Digital Image Processing FundamentalsEdge Detection Algorithms

20

Edge-following algorithms

Edge following based on dynamic programming: a) original

image; b) edge followed.

Page 21: Edge Detection summary - icarus.csd.auth.gr

Contour detection

β€’ Contour detection is more difficult than edge detection.

β€’ It is useful for shape analysis and object recognition.

β€’ Simplest contour description: ordered list of contour pixels

π‘₯𝑖 , 𝑦𝑖𝑇 , 𝑖 = 1, …𝑁.

21

Page 22: Edge Detection summary - icarus.csd.auth.gr

Contour following

22

a) Tooth cross-section mosaic; b) tooth and oral cavity contour following.

Page 23: Edge Detection summary - icarus.csd.auth.gr

Square Tracing Algorithm

β€’ Start at start pixel 𝐩 at the bottom left corner of

image 𝒳.

β€’ Scan each pixel column from bottom to top and left

to right until encounter a black pixel 𝐱 belonging to

𝒫 and insert 𝐱 in ℬ. Now the start pixel 𝐩 is 𝐱. Then:

β€’ If you find black pixel 𝐱, turn right, until you

encounter the start pixel again. The black pixels

you walked over will be the contour of the pattern.

23

On a black pixel,

turn left, on a white

pixel, turn right..

Contour following algorithms

[GHU2000]

Page 24: Edge Detection summary - icarus.csd.auth.gr

Active Contoursβ€’ Active contours or snakes are deformable models of an

image contour.

β€’ They describe object boundaries/contours by a parametric

curve.

β€’ An energy functional is always associated with an active

contour.

β€’ The desired contour is obtained by defining energy

functional minimization.

24

Page 25: Edge Detection summary - icarus.csd.auth.gr

Active Contours

25

Active contour on a brain CT image.

[HEM2018]

Page 26: Edge Detection summary - icarus.csd.auth.gr

NN Edge detection

β€’ A Neural Network (NN) edge detector can be considered

as a nonlinear filter: it can have a built-in thresholding

capability.

β€’ Thus, the filtering, thresholding operation of edge detection

is a natural application for neural network processing.

Convolutional Neural networks (CNN) have convolutional

layers and nonlinear activation functions interspersed with

pooling (subsampling) layers.

β€’ Typical CNN convolution kernels perform edge detection

(learned only by training).

26

Page 27: Edge Detection summary - icarus.csd.auth.gr

ZFNet convolution kernels that have been produced by training to perform

edge/line detection.

orientation selectivity

found in V1 simple cells

green/red color opponency

observed in retinal neurons

and human visual perception

blue/yellow color opponency

observed in retinal neurons

and human visual perception

NN Edge detection

Page 28: Edge Detection summary - icarus.csd.auth.gr

NN Edge detection

28

Page 29: Edge Detection summary - icarus.csd.auth.gr

SVM Edge Detection

β€’ SVM classification

β€’ ”the pixel is part of an edge β€œ or ” the pixel is not part of an edge”

β†’Binary classification.

29

a) Edge image with SVM method; b) Edge image by using the Sobel operator.

[GOH2000]

Page 30: Edge Detection summary - icarus.csd.auth.gr

NN Contour detection

30

Contour detection results comparison in Cassini ISS images by using different methods

a) Original Image; b) CNN.

[LI2019]

Page 31: Edge Detection summary - icarus.csd.auth.gr

Q & A

Thank you very much for your attention!

Contact: Prof. I. Pitas

[email protected]

31