Chapter 3-Image Enhancement in Spatial Domain II
Chapter 3-Image Enhancement in Spatial Domain II
(x, y)
Neighbourhood
y Image f (x, y)
Some simple neighbourhood operations include:
Min: Set nilai pixel untuk minimum in the neighbourhood.
Max: Set nilai pixel untuk maximum in the neighbourhood.
Median: Nilai median dari himpunan bilangan adalah nilai titik
tengah (contoh dari set[1, 7, 15, 18, 24] 15 is the median).
Smoothing filters digunakan untuk mengaburkan
dan untuk mengurangi noise.
Blurring digunakan dalam langkah preprocessing,
seperti penghapusan detil kecil dari objek
gambar sebelum ekstraksi.
Pengurangan noise dapat dicapai dengan mengaburkan
suatu image.
Linear spatial filter adalah rata - rata dari
pixel yang terdapat di sekitar filter mask.
Kadang-kadang disebut "filter rata-rata".
Idenya adalah mengganti nilai setiap pixel gambar
dengan rata-rata gray level yang telah
didefinisikan oleh filter mask.
1 1 1 1 2 1
1 1
1 1 1 2 4 2
9 16
1 1 1 1 2 1
1/ 1/ 1/
9 9 9
Simple averaging filter
a b c r s t
Original image x
d
g
e
h
f
i
* u
x
v
y
w
z
Original Image Filter
Simple 3*3 e Pixels
Neighbourhood
3*3 Filter eprocessed = v*e +
r*a + s*b + t*c +
u*d + w*f +
y Image f (x, y) x*g + y*h + z*i
Proses di atas diulang untuk setiap pixel dalam gambar asli untuk
menghasilkan filtering image.
1/ 1/ 1/
Original image x 104 100 108 9 9 9
1/ 1/ 1/
99 106 98
95 90 85
* 1/
9
9
1/
9
9
1/
9
1/ 100
9 /9 108
104 1 1/ Original Image Filter
Simple 3*3 1/
9
/9 198
999 1106 /9
3*3 Smoothing Pixels
Neighbourhood /9 190
195 /9 185
/9
Filter
e = 1/9*106 +
1/ *104 + 1/ *100 + 1/ *108 +
9 9 9
1/ *99 + 1/ *98 +
9 9
y Image f (x, y) 1/ *95 + 1/ *90 + 1/ *85
9 9 9
= 98.3333
Proses di atas diulang untuk setiap pixel untuk menghasilkan smooth image.
Original Image Smoothed Image
Histograms of pixels in an image
Histogram dapat digunakan untuk:
Mencapai kecerahan yang diinginkan and contrast
range yang diinginkan.
Dapat menentukan apakah pencahayaan atau bayangan
kehilangan detail pixel value.
Mengidentifikasi dan memperbaiki pergeseran warna.
Misalnya: Histogram Equalization.
The histogram is a graphical representation of the
brightness levels (from pure black to pure white), and the
relative count of pixels within each brightness level.
The horizontal axis represents tonal values from 0 to 255. Eight-bit files have 256
tonal values. 12-bit, 4096. 16-bit, 65536.
im=imread('lena512.bmp');
im=rgb2gray(im);
figure(1);
imshow(im);
figure(2);
imhist(im);
image=histeq(im);
figure(3);
imshow(image);
figure(4);
imhist(image);
Red Green Blue
Contoh Histogram
Mid-tone
118 R
124 G
Shadow 136 B
24 R
23 G
18 B Highlights
238 R