Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

37
Digital Image Processing, 3rd ed. www.ImageProcessingPlace.com 992–2008 R. C. Gonzalez & R. E. Woods Gonzalez & Woods Chapter 10 Segmentation

description

Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1]; g=abs(imfilter ( double(f), w); T=max(g(:)); g=g >=T; imshow(g);. w=[2 -1 -1;-1 2 -1; -1 -1 2]; g=imfilter(double(f), w); imshow(g, []) %Fig.10.4-b g=abs(g( :)); figure, imshow(g, [ ]) % Fig.10-4-e - PowerPoint PPT Presentation

Transcript of Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Page 1: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 2: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 3: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 4: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 5: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Find the location of the points as follows:

w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

g=abs(imfilter ( double(f), w);

T=max(g(:));

g=g >=T;

imshow(g);

Page 6: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 7: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 8: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

w=[2 -1 -1;-1 2 -1; -1 -1 2];g=imfilter(double(f), w);imshow(g, []) %Fig.10.4-bg=abs(g(:));figure, imshow(g, [ ]) % Fig.10-4-eT=max(g (: ));G=g >= T;figure, imshow(g, [ ]) % Fig.10-4-f

Page 9: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 10: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 11: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 12: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 13: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

• The image Gradient and its properties– The total of choice for finding edge strenth and direction at

location (x,y) of an image, f, is the gradient, denoted by f, and defined as the vector

y

f

x

f

g

gfgradf

y

x)(

Page 14: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

• The image Gradient and its properties– Magnitude (length) of vector f, denoted as M(x,y)– The direction of the gradient vector is given by the angle α(x,y)

x

y

yx

g

gyx

ggfmagyxM

1

22

tan),(

)(),(

Page 15: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 16: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 17: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 18: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 19: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 20: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 21: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

• IPT’s function edge provides several derivative estimators. For some of these estimators, it is possible to stecify whether thye edge detector is sensitive to horizontal or vertical edges or to both. The general sytax for this function is

• [g, t]= edge (f, ‘method’ , parameters)

Where f is the input image, method is one of the approaches listed in Table and parameters are additional parameters explained later.

Page 22: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

• The general calling syntax for the Sobel detector is

[g, t] = edge (f, ‘sobel’ , T , dir)

where T is a specified threshold, and dir specifies the preferred direction of the edges detected: ‘horizontal’, ‘vertical’ , or ‘both’ ( the default).

As noted earlier, g is a logical image containing 1s at locations where edges were detecfted and 0s elsewhere.

Page 23: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

• The Prewitt edge detector uses the masks in Fig.10.14 to approximate digitally the first derivatives Gx and Gy. It’s general calling synax is

[g,t]=edge(f,’prewitt’, T, dir)

the parameters of this function are identical to the Sobel parameters.

Page 24: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 25: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 26: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 27: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 28: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

More Advanced Techniques for Edge Detection

• Marr-Hildreth edge detector– Marr and Hildreth argued that

• (1) intensity changes are not independent of image scale and so their detection requires the use of operators different sizes and

• (2) that a sudden intensity change will give rise to a peak or trough in the first derivative or, equivalently, to zero crossing in the second derivative.

Page 29: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

• Marr-Hildreth edge detector• Marr and Hildreth argued that the most satisfactory operator fulfilling these

conditions is the filter 2G where, 2 is the Laplacian operator, and G is the 2-D Gaussian function

(LoG)Gaussion a ofLaplacian called is expression This

2),(

11),(

),(

),(),(),(

),(

2

22

2

22

2

22

2

22

2

22

2

22

24

2222

224

22

24

22

22

22

2

2

2

2

22

2

yx

yxyx

yxyx

yx

eyx

yxG

ey

ex

yxG

ey

yex

xyxG

y

yxG

x

yxGyxG

eyxG

Page 30: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 31: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

• The general calling syntax for the LoG detector is;

[g,t]= edge (f, ‘log’, T, sigma)

where sigma is the standard deviation and the other parameters are explained previously.

Page 32: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

• Zero Crossing Detector:

This detector is based on the same concept as the LoG method, but the convolution is carried out using a specified filter function, H. The calling syntax is

[g,t]= edge(f, ‘zerocross’, T, H)

The other parameters are as explained for the LoG detector.

Page 33: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 34: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 35: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 36: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation

Page 37: Find the location of the points as follows: w=[-1 -1 -1; -1 8 -1; -1 -1 -1];

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

© 1992–2008 R. C. Gonzalez & R. E. Woods

Gonzalez & Woods

Chapter 10

Segmentation

Chapter 10

Segmentation