part 11 image segmentation - canerozcan.net

52
CME429 Introduction to Image Processing Assist. Prof. Dr. Caner ÖZCAN Part 11 Image Segmentation The whole is equal to the sum of its parts. ~Euclid The whole is greater than the sum of its parts. ~Max Wertheimer

Upload: others

Post on 15-Mar-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

CME429 Introduction to Image Processing

Assist. Prof. Dr. Caner ÖZCAN

Part 11 Image Segmentation

The whole is equal to the sum of its parts. ~Euclid The whole is greater than the sum of its parts. ~Max Wertheimer

Outline

2

10. Image Segmentation ►Fundamentals

►Point, Line, and Edge Detection

►Thresholding

►Region-Based Segmentation

►Segmentation Using Morphological Watersheds

►The Use of Motion in Segmentation

3

Background

4

►First-order derivative

►Second-order derivative

'( ) ( 1) ( )f

f x f x f xx

2

2( 1) ( 1) 2 ( )

ff x f x f x

x

5

Detection of Isolated Points

6

►The Laplacian

2 2

2

2 2( , )

( 1, ) ( 1, ) ( , 1) ( , 1)

4 ( , )

f ff x y

x y

f x y f x y f x y f x y

f x y

1 if | ( , ) |( , )

0 otherwise

R x y Tg x y

9

1

k k

k

R w z

7

Line Detection

8

►Second derivatives to result in a stronger response and to produce thinner lines than first derivatives

►Double-line effect of the second derivative must be handled properly

9

Detecting Line in Specified Directions

10

11

Edge Detection

12

►Edges are pixels where the brightness function changes abruptly

►Edge models

13

14

15

Basic Edge Detection by Using First-Order Derivative

16

2 2

1

( )

The magnitude of

( , ) mag( )

The direction of

( , ) tan

The direction of the edge

- 90

x

y

x y

x

y

f

g xf grad f

fg

y

f

M x y f g g

f

gx y

g

Basic Edge Detection by Using First-Order Derivative

17

Edge normal: ( )

Edge unit normal: / mag( )

x

y

f

g xf grad f

fg

y

f f

In practice,sometimes the magnitude is approximated by

mag( )= + or mag( )=max | |,| |f f f f

f fx y x y

18

19

20

21

22

23

24

The Canny Edge Detector

25

►Optimal for step edges corrupted by white noise.

►The Objective

1.Low error rate The edges detected must be as close as possible to the true edge

2.Edge points should be well localized The edges located must be as close as possible to the true edges

3.Single edge point response The number of local maxima around the true edge should be minimum

The Canny Edge Detection: Summary

26

►Smooth the input image with a Gaussian filter

►Compute the gradient magnitude and angle images

►Apply nonmaxima suppression to the gradient magnitude image

►Use double thresholding and connectivity analysis to detect and link edges

27

0.04; 0.10; 4 and a mask of size 25 25L HT T

28 0.05; 0.15; 2 and a mask of size 13 13L HT T

29

30

Segmentation with Matlab

31

Segmentation with Matlab

32

Segmentation with Matlab

33

Segmentation with Matlab

34

Segmentation with Matlab

35

Segmentation with Matlab

36

Segmentation with Matlab

37

Segmentation with Matlab

38

Segmentation with Matlab

39

Segmentation with Matlab

40

Segmentation with Matlab

41

Segmentation with Matlab

42

Segmentation with Matlab

43

Segmentation with Matlab

44

Segmentation with Matlab

45

Segmentation with Matlab

46

Segmentation with Matlab

47

Segmentation with Matlab

48

Segmentation with Matlab

49

Segmentation with Matlab

50

Segmentation with Matlab

51

References

52

►Sayısal Görüntü İşleme, Palme Publishing, Third Press Trans. (Orj: R.C. Gonzalez and R.E. Woods: "Digital Image Processing", Prentice Hall, 3rd edition, 2008).

►“Digital Image Processing Using Matlab”, Gonzalez & Richard E. Woods, Steven L. Eddins, Gatesmark Publishing, 2009

►Lecture Notes, CS589-04 Digital Image Processing, Frank (Qingzhong) Liu, http://www.cs.nmt.edu/~ip

►Lecture Notes, BIL717-Image Processing, Erkut Erdem ►Lecture Notes, EBM537-Image Processing, F.Karabiber ► Image Processing Made Easy,

https://www.youtube.com/watch?v=1-jURfDzP1s