Tujuan Peningkatan Mutu Citra
Peningkatan Mutu Citra
(image enhancement)
(Image Enhancement) pada Domain Spasial Kuliah ke-3 Program Studi S1 Reguler Departemen Teknik Elektro, FTUI Slides ©2009
y Tujuan: melakukan pemrosesan terhadap citra agar
hasilnya dapat lebih baik dari citra awal untuk aplikasi tertentu y Kriteria baik tergantung pada aplikasi dan problem: { {
Secara visuall Secara otomatis (untuk aplikasi selanjutnya)
Our topics
Point Processing
Image Enhancement
y Cara paling mudah y Pemrosesan hanya melibatkan satu piksel saja (tidak
menggunakan jendela ketetanggaan) Spatiall Domain
y Contoh: contrast stretching, histogram
Frequency Domain
manipulation, etc.
…(next lecture)
Point Processing
Mask Processing
Mask Processing - 1
Mask Processing - 2
y Operasi terhadap suatu jendela ketetanggaan pada
citra y Konvolusi suatu mask terhadap jendela tersebut y Mask ini sering disebut filter
1 2 3 8 x 4 7 6 5
Contoh: Jendela ketetanggan 3 ¯ 3, Nilai piksel pada posisi X dipengaruhi oleh nilai 8 tetangganya Æ Perbedaan dengan point processing: pada point processing, nilai suatu piksel tidak dipengaruhi oleh nilai tetanggatetangganya
1
Mask Processing - 3 W1
W2
W3
W4
W5
W6
W7
W8
W9
Mask/filter berukuran 3×3. Filter ini akan diterapkan/dikonvolusikan pada setiap jendela ketetanggaan 3 × 3 pada citra
G11 G12 G13 G14 G15 G21
G22 G23 G24 G25
G31 G32 G33 G34 G35
G22’ = w1 G11 + w2 G12 + w3 G13 + w4 G21 + w5 G22 + w6 G23 + w7 G31 + w8 G32 + w9 G33
Jenis-jenis filter spasial y Smoothing filters: { Lowpass filter (mengambil nilai rata-rata) { Median filter (mengambil median dari setiap jendela ketetanggaan) y Sharpening filters: { Roberts, Prewitt, Sobel (edge detection) { Highpass filter
G41 G42 G43 G44 G45 G51 G52 G53 G54 G55
Neighborhood Concept (3×3)
Grey Level Transformation (contrast enhancement)
Transformation function s = T(r) For point processing (mask 1×1 )
Contrast Stretching
Several Transformation Functions (image enhancement)
Thresholding (result: Binary Image)
Example of Negative Transformation
Transformation function: s = T(r)
Digital Mammogram (original)
Negative Transform s=L-1-r
2
Log Transformation
Gamma Transformation
s=crγ Fourier Spectrum (Original, range=0 - 106)
Fourier Spectrum s = c log(1 + r), c=1 Range= 0 - 6.2
Gamma Correction on CRT
Another Example of Gamma Correction
Response of monitor
Linear-wedge gray scale image
Gamma-corrected γ=0.6
Darker than original
Almost the same Gamma-corrected wedge γ=1/2.5=0.4
Response of monitor
Another Example of Gamma Correction
Gamma-corrected
Gamma-corrected
γ=0.4
γ=0.3
Piecewise Linear Transformation
3
Grey Level Slicing
Bit Plane
Example: 8-bit fractal image
Bit Plane Slicing
Original Image
Bit plane 7,6,5, …0
Histogram Processing
Four Basic Image Types – Histogram
y Histogram: diagram yang menunjukkan jumlah
kemunculan grey level (0-255) pada suatu citra y Histogram processing: { Gambar gelap: histogram cenderung ke sebelah kiri { Gambar terang: g histogram g cenderung g ke sebelah kanan { Gambar low contrast: histogram mengumpul di suatu tempat { Gambar high contrast: histogram merata di semua tempat Æ Histogram processing: mengubah bentuk histogram agar pemetaan gray level pada citra juga berubah
4
Histogram Equalization
Transformation Function
y Ide: mengubah pemetaan
greylevel agar sebarannya (kontrasnya) lebih menyebar pada kisaran 0-255 (untuk citra 8 – bit) y Sifat: {
{
{
Grey level yang sering muncul lebih dijarangkan jaraknya dengan grey level sebelumnya Grey level yang jarang muncul bisa lebih dirapatkan jaraknya dengan grey level sebelumnya Histogram baru pasti mencapai nilai maksimal keabuan (contoh: 255)
nj
j =0
n
k
= ∑ p(rj ) j =0
0 ≤ rk ≤ 1 dan k = 0,1,....., L − 1 L adalah grey level maksimal yang ada dalam citra
Example Example Image: Image: An image with 0 – 10 grey level values
k
sk = T (rk ) = ∑
Histogram Specification
Original Image 3 5 5 5 4 5 4 5 4 4 5 3 4 4 4 4 5 6 6 3
y Equalization tidak
Histeq Image 1 9 9 9 5 9 5 9 5 5 9 1 5 5 5 5 9 10 10 1
Grey Level
0
1
2
3
4
5
6
7
8
9
10
Number of occurence
0
0
0
3
8
7
2
0
0
0
0
Probability of Occurence
0
0
0
0.15
0.40
0.35
0.1
0
0
0
0
Sk
0
0
0
0.15
0.55
0.90
1
1
1
1
1
5.5
9
10
10
10
10
10
5
9
10
10
10
10
10
Sk * 10
0
0
0
1.5
New Grey Level
0
0
0
1
Local Enhancement
dilakukan pada seluruh bagian histogram tapi hanya pada bagian tertentu saja
Histeq Examples
z Histogram equalization hanya dilakukan pada
bagian tertentu dari citra
Four basic images • Dark • Light • Low contrast • High contrast
5
Transformation Functions of Histeq
Local Enhancement (masking)
Local Enhancement
Transformation Result
Local mean Local std. dev.
Arithmatic/Logic Operation: AND, OR
Image Difference
1 AND
-
=
=
0
OR
=
Histeq1
-
Histeq2
=
6
Image Substraction
Noisy Image – Averaging
Iodine medium in blood stream Spinal cord
Image Differences
Spatial Filtering using Mask
Spatial Filter Mask Representation (3×3)
A 3×3 Smoothing Filters
7
Filtering Results (a) Original image; (b)-(f) Filter mask with 3,5,9,15 and 35 of size (a)
(c)
(b)
Smoothing & Thresholding (a) Citra teleskop Hubble (b) Smoothing 15×15 (c) Thresholding
(d)
(e)
(f)
Intensity Profile and Derivation Concept
Noise Reduction by Filtering (a) X-ray corrupted by salt-and-pepper noise (b) Noise reduction with a 3×3 averaging mask (c) Noise reduction with a 3×3 median filter Æ better
Laplacian Filters
Laplacian Filter
• Extension to diagonal neighbors • Two other implementation Digital Laplacian xdirection
Image of North Pole of the Moon
Laplacian filtered-image
Scaled for displaying
ydirection Bothdirection
Enhanced
8
Laplacian Filter
High Boost Filter
Composite Laplacian mask
Original Image 2nd composite Laplacian mask
High boost filters type 1 High boost filters type 2
Filtering result using 2nd CLM (sharper)
Filtering result using CLM
Laplacian Filters (contd.)
Derivative Filters
Masking result using High Boost Filter type 2 (A=0)
Original Image, but darker
A ≥1
3×3 region of image • Masks used to compute gradient/derivative at z5
All mask coeff. sum to 0 Masking result using High Boost Filter type 2 (A=1.7)
Masking result using High Boost Filter type 2 (A=1)
Sobel Gradient
Defects seen visually
• Derivative operator qualification
Combined Filters
Clearer defects
9
Combined Filters (c0ntd.)
Video’s Time
Video today BMW, the large vehicle manufacturer used various technology in building a new 3-series You can see the process fullyy automated and only a small portion manufactured manually by human
MATLAB® Time FOR YOUR OWN GOOD, START LEARNING FROM NOW!
This is one of example in image processing application (e.g. painting QC, welding QC, etc.)
Matlab: Noise reduction y Cari menu untuk filtering y Untuk berbagai jenis noise, gunakan filter: {
Median
{
Adaptive Averaging
{ { {
Histogram processing Low pass, high pass, boost-up, etc.
y Coba berbagai ukuran filter neighborhood (window) {
3×3, 5×5, 7×7, etc.
{
Gunakan nilai variable A yang berbeda (mis. pada Laplacian)
y Gunakan kombinasi beberapa jenis filter, bandingkan
hasilnya
10