histogram 直方圖 statistics of the pixel gray-levels of an image h(r k )=n k : histogram gray...
Post on 22-Dec-2015
246 views
TRANSCRIPT
Histogram 直方圖 Statistics of the pixel gray-levels of an ima
ge h(rk)=nk : histogram
gray level
no. of occurrence
histogram p=imread(‘pout.tif’); imshow(p), figure, imhist(p), axis tight
Histogram equalization
ph=histeq(p);
Histogram equalization (cont.)
[ph, t]=histeq(p); plot(t), title('transform function');
Exercise#1.Apply histogram equalizationto tire image
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
Exercise#2: average filtering
Use the test pattern to generate the following results.
original
5x5
15x15
3x3
9x9
35x35
Definition of 1st derivative in mask filters
Sobel operators
Exercise#3: 1st derivative Apply the Sobel filters to the lens image
水平邊
垂直邊 | 垂直邊 |+| 水平邊 |
Definition of 2nd derivatives in filter mask: Laplacian
900 rotationinvariant
450 rotationinvariant(include Diagonals)
4 -
-
-
- -
- - -
-
---
8
Exercise#4: sharpening filter
Generate the right images
original
Laplacianscaled sharpened