histogram 直方圖 statistics of the pixel gray-levels of an image h(r k )=n k : histogram gray...

10
Histogram 直直直 Statistics of the pixel gray-leve ls of an image h(r k )=n k : histogram gray level no. of occurrence

Post on 22-Dec-2015

246 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Histogram 直方圖 Statistics of the pixel gray-levels of an image h(r k )=n k : histogram gray level no. of occurrence

Histogram 直方圖 Statistics of the pixel gray-levels of an ima

ge h(rk)=nk : histogram

gray level

no. of occurrence

Page 2: Histogram 直方圖 Statistics of the pixel gray-levels of an image h(r k )=n k : histogram gray level no. of occurrence

histogram p=imread(‘pout.tif’); imshow(p), figure, imhist(p), axis tight

Page 3: Histogram 直方圖 Statistics of the pixel gray-levels of an image h(r k )=n k : histogram gray level no. of occurrence

Histogram equalization

ph=histeq(p);

Page 4: Histogram 直方圖 Statistics of the pixel gray-levels of an image h(r k )=n k : histogram gray level no. of occurrence

Histogram equalization (cont.)

[ph, t]=histeq(p); plot(t), title('transform function');

Exercise#1.Apply histogram equalizationto tire image

Page 5: Histogram 直方圖 Statistics of the pixel gray-levels of an image h(r k )=n k : histogram gray level no. of occurrence

Filtering in MATLAB x=uint8(10*magic(5)); a=ones(3,3)/9; filter2(a,x,’same’); % output has same size, zero

padding

filter2(a,x,’valid’); % apply to inside of image

filter2(a,x,’full’); % apply to each intersection between mask

and image

ans =

76.6667 85.5556 65.5556 67.7778 58.8889 87.7778 111.1111 108.8889 128.8889 105.5556 66.6667 110.0000 130.0000 150.0000 106.6667 67.7778 131.1111 151.1111 148.8889 85.5556 56.6667 105.5556 107.7778 87.7778 38.8889

Page 6: Histogram 直方圖 Statistics of the pixel gray-levels of an image h(r k )=n k : histogram gray level no. of occurrence

Exercise#2: average filtering

Use the test pattern to generate the following results.

original

5x5

15x15

3x3

9x9

35x35

Page 7: Histogram 直方圖 Statistics of the pixel gray-levels of an image h(r k )=n k : histogram gray level no. of occurrence

Definition of 1st derivative in mask filters

Sobel operators

Page 8: Histogram 直方圖 Statistics of the pixel gray-levels of an image h(r k )=n k : histogram gray level no. of occurrence

Exercise#3: 1st derivative Apply the Sobel filters to the lens image

水平邊

垂直邊 | 垂直邊 |+| 水平邊 |

Page 9: Histogram 直方圖 Statistics of the pixel gray-levels of an image h(r k )=n k : histogram gray level no. of occurrence

Definition of 2nd derivatives in filter mask: Laplacian

900 rotationinvariant

450 rotationinvariant(include Diagonals)

4 -

-

-

- -

- - -

-

---

8

Page 10: Histogram 直方圖 Statistics of the pixel gray-levels of an image h(r k )=n k : histogram gray level no. of occurrence

Exercise#4: sharpening filter

Generate the right images

original

Laplacianscaled sharpened