Neighborhood Processing

Slides:



Advertisements
Presentasi serupa
Aplikasi Transformasi Citra – Beberapa Contoh
Advertisements

Perbaikan Citra pada Domain Spasial
RANGKAIAN LOGIKA KOMBINASIONAL
Image Restoration.
Pengolahan Citra Digital: Peningkatan Mutu Citra Pada Domain Spasial
Game Theory Purdianta, ST., MT..
Korelasi Linier KUSWANTO Korelasi Keeratan hubungan antara 2 variabel yang saling bebas Walaupun dilambangkan dengan X dan Y namun keduanya diasumsikan.
K-Map Using different rules and properties in Boolean algebra can simplify Boolean equations May involve many of rules / properties during simplification.
Teorema Green.
Edge Detection (Pendeteksian Tepi)
BLACK BOX TESTING.
Presented By : Group 2. A solution of an equation in two variables of the form. Ax + By = C and Ax + By + C = 0 A and B are not both zero, is an ordered.
Image Enhancement.
Testing Implementasi Sistem Oleh :Rifiana Arief, SKom, MMSI
Filter Spasial Citra.
Edge Detection Dr. Aniati Murni (R 1202) Dina Chahyati, SKom (R 1226)
CS3204 Pengolahan Citra - UAS
Fuzzy for Image Processing
Floating Point (Multiplication)
Masalah Transportasi II (Transportation Problem II)
Pertemuan 07 Peluang Beberapa Sebaran Khusus Peubah Acak Kontinu
1 HAMPIRAN NUMERIK SOLUSI PERSAMAAN LANJAR Pertemuan 5 Matakuliah: K0342 / Metode Numerik I Tahun: 2006 TIK:Mahasiswa dapat meghitung nilai hampiran numerik.
9.3 Geometric Sequences and Series. Objective To find specified terms and the common ratio in a geometric sequence. To find the partial sum of a geometric.
Pengolahan Citra Digital: Peningkatan Mutu Citra Pada Domain Spasial
Aplikasi Transformasi Citra Beberapa Contoh
Chapter 10 – The Design of Feedback Control Systems PID Compensation Networks.
Comparative Statics Slutsky Equation
Keuangan dan Akuntansi Proyek Modul 2: BASIC TOOLS CHRISTIONO UTOMO, Ph.D. Bidang Manajemen Proyek ITS 2011.
Smoothing. Basic Smoothing Models Moving average, weighted moving average, exponential smoothing Single and Double Smoothing First order exponential smoothing.
Jartel, Sukiswo Sukiswo
KONVOLUSI Oleh : Edy Mulyanto.
Materi 02(b) Pengolahan Citra Digital
STATISTIKA CHATPER 4 (Perhitungan Dispersi (Sebaran))
KOMUNIKASI DATA Materi Pertemuan 3.
Image Segmentation.
Operasi Matematis Pada Citra
Cartesian coordinates in two dimensions
Cartesian coordinates in two dimensions
MODUL 4 PERBAIKAN KUALITAS CITRA (2)
The contents This lectures we will look at image enhancement techniques working in the spatial domain: What is image enhancement? Different kinds of image.
DETEKSI TEPI.
Pengujian Hipotesis (I) Pertemuan 11
Matakuliah : I0014 / Biostatistika Tahun : 2005 Versi : V1 / R1
Pengolahan Citra Digital
Image Enhancement –Spatial Filtering
Filtering dan Konvolusi
VECTOR VECTOR IN PLANE.
Peningkatan Mutu Citra
Nana Ramadijanti, Ahmad Basuki, Hero Yudo Martono
Pendugaan Parameter (II) Pertemuan 10
REAL NUMBERS EKSPONENT NUMBERS.
FACTORING ALGEBRAIC EXPRESSIONS
Image Segmentation.
Pengolahan Citra Digital: Peningkatan Mutu Citra Pada Domain Spasial
Deteksi Tepi Pengolahan Citra Danar Putra Pamungkas, M.Kom
Filtering dan Konvolusi
Pengolahan Citra Digital Peningkatan Mutu/Kualitas Citra
Master data Management
Pertemuan 4 CLASS DIAGRAM.
Operasi Matematis Pada Citra
Convolution and Correlation
Things You Need to Know Before Running on the Beach.
Simultaneous Linear Equations
I. Fourier Spectra Citra Input Peningkatan mutu citra pada domain frekuensi Fourier dilakukan secara straightforward: Hitung transformasi Fourier dari.
Edge Detection Dr. Aniati Murni (R 1202) Dina Chahyati, SKom (R 1226)
By Yulius Suprianto Macroeconomics | 02 Maret 2019 Chapter-5: The Standard of Living Over Time and A Cross Countries Source: http//
Al Muizzuddin F Matematika Ekonomi Lanjutan 2013
Vector. A VECTOR can describe anything that has both MAGNITUDE and DIRECTION The MAGNITUDE describes the size of the vector. The DIRECTION tells you where.
Pemrosesan Bukan Teks (Citra)
Wednesday/ September,  There are lots of problems with trade ◦ There may be some ways that some governments can make things better by intervening.
Transcript presentasi:

Neighborhood Processing Introduction Filters (LPF, HPF, Gaussian Filter, …) Region of interest processing

Basic Image Processing Operations Neighborhood processing process the pixel with its neighbors Point operations process according to the pixel’s value alone.

Point Operations 3

Point Processing Nonlinear Raise Contrast Original Darken Lower Contrast Nonlinear Lower Contrast Invert Lighten Raise Contrast 4

Point Processing Nonlinear Raise Contrast Original Darken Lower Contrast x x - 128 x / 2 ((x / 255.0) ^ 0.33) * 255.0 Nonlinear Lower Contrast Invert Lighten Raise Contrast 255 - x x + 128 x * 2 ((x / 255.0) ^2) * 255.0 5

Neighborhood Operations 6

Neighborhood operations Image Edge detection Blur Deteksi tepi ( Edge detection ) adalah operasi yang dijalankan untuk mendeteksi garis tepi (edges) yang membatasi dua wilayah citra homogen yang memiliki tingkat kecerahan yang berbeda Tujuannya adalah untuk mengubah citra 2D menjadi bentuk kurva . 7

Neighborhood Processing 3x3 Mask Output derives from multiplying all elements in the mask by corresponding elements in the neighborhood and adding together all these products.

Filter A rule or procedure for processing an image Combination of mask and function Goal: separating/attenuating a desired component of an observed image Type: Linear (function), Nonlinear (function) Low-pass filter (LPF), High-pass filter (HPF), Band-pass filter (BPF)

Steps of Linear Spatial Filtering Position the mask over the current pixel. Form all products of filter elements with the corresponding elements of the neighborhood. Add all products. Other names for mask: filter, filter mask, kernel, template or window, etc.

Linear Spatial Filter: Example (1) 1/9 2 15 10 20 10 Average Filter 10 10 15 10 5 20 10 10 15 Find the output intensity of the blue pixel.

Linear Spatial Filter: Example (2) 15 10 20 1/9 1/9 1/9 1/9 10 1/9 15 1/9 1/9 1/9 1/9 20 10 10 Multiply the number in the filter’s element with the corresponding pixel’s intensity.

Linear Spatial Filter: Example (3) 15/9 + 10/9 + 20/9 + 0/9 + 10/9 + 15/9 + 20/9 + 10/9 + 10/9 = 12.22 15/9 10/9 20/9 0/9 10/9 15/9 20/9 10/9 10/9 Output intensity of blue pixel = 12.22 Add all products for output. Spatial filtering is spatial convolution.

Correlation and Convolution of Digital Image

Correlation Sum of the product of mask and intensity on each point.

Example: Correlation (1) 3 2 4 5 10 20 10 15 5 5 10 15 10 Kernel 20 10 20 20 15 5 10 5 10 10 20 15 10

Example: Correlation (2) 101 +152 +103 +102 +203 +154 +53 +04 +05 = 225 10 15 10 1 2 3 10 2 20 3 15 4 3 4 5 5 Multiply and sum all products.

Exercise: Correlation 1 3 2 4 5 Kernel 1 10 Find the correlation of the green kernel to the above image.

Convolution Sum of the response on each point

Example: Convolution (1) 5 3 4 2 1 10 20 10 15 5 5 10 15 10 Reverse Kernel!! 20 10 20 20 15 5 10 5 10 1 3 2 4 5 10 20 15 10 Kernel

Example: Convolution (2) 105 +154 +103 +104 +203 +152 +53 +02 +01 = 285 10 15 10 5 4 3 10 4 20 3 15 2 3 2 1 5 Multiply and sum all products.

Exercise: Convolution 1 3 2 4 5 Kernel 1 10 Find the convolution of the green kernel to the above image.

Filtering the Image

Example: HPF Kernel Input image 1 -2 4 10 20 10 15 5 5 10 15 10 20 10 20 10 20 15 5 Kernel 10 5 10 10 20 15 10 Input image

Example: HPF (2) Filtered Image 10 20 10 15 5 5 20 -10 20 -40 25 15 5 20 -10 20 -40 25 15 5 10 5 -35 10 10 20 15 10 Filtered Image

Edges of The Image A linear filter is represented as a matrix, e.g., the 3 x 3 averaging filter. Edges of the Image There are a number of different approaches to dealing with this problem. Ignore the edges: The mask is applied to all pixels except the edges and results in an output image that is smaller than the original. If the mask is very large, a significant amount of information may be lost. Pad with zeros: We assume that all necessary values outside the image are zero. It will return an output image of the same size as the original, but may have the effect of introducing unwanted artifacts, e.g., edges, around the image. 1/9

Edges of The Image Batas atau tepi citra (edges of the image) hal yang harus diselesaikan dalam operasi filtering misalnya, bagaimana jika sebagian “mask” berada di luar citra.

Edges of The Image (1) Tidak mempedulikan batas atau tepi citra “mask” hanya diaplikasikan pada piksel-piksel citra dimana seluruh “mask” berada dalam citra. Pendekatan ini menghasilkan citra output yang ukurannya lebih kecil daripada citra input. Jika ukuran “mask” sangat besar, akan menyebabkan sejumlah besar informasi menjadi hilang.

Edges of The Image (2) Tambahkan piksel-piksel dengan nilai 0 (Pad with zeroes) Dalam pendekatan ini, diasumsikan bahwa semua piksel yang berada di luar citra mempunyai nilai grey-level nol. Pendekatan ini menghasilkan citra output yang ukurannya sama dengan citra input, namun kadang mempunyai pengaruh pada batas-batas tepi citra.

Filtering in MATLAB Command: filter2 Syntax: filter2(filter, image, shape); filter2(filter, image); shape: ‘same’: pad edge with zeros. Size unchanged. (default) ‘valid’: apply mask only to inside pixel. Size smaller. ‘full’: pad edge with zeros and applying the filter at all places on and around the image where the mask intersects the image matrix. Size larger.

Filter Construction in MATLAB Command: fspecial Syntax: fspecial(type, parameter); fspecial(type); type: type of the filter ‘average’ : average filter ‘gaussian’ : Gaussian filter ‘laplacian’ : Laplacian filter … parameter: parameter of the filter (size, sigma, …). Default varies among filter. Try!!!

Filter Construction in MATLAB

HALF

Filter on Frequency Domain Low-pass filter (LPF): filter that allows only the low-frequency components and reduces or eliminates the high-frequency components. E.g. Gaussian, average High-pass filter (HPF): filter that allows only the high-frequency components and reduces or eliminates the low-frequency components. E.g. Laplacian, Prewitt, Sobel Spatial data (intensity) transformed by Fourier transform. Simplified version: high-frequency indicates the abrupt changes in intensity  edges. low-frequency indicates the intensity smoothness  uniform region.

Computing Consideration Filter may lead to the value outside [0,255] Solution 1: Make negative values positive (use absolute value)  good when there are few negative values and the negative values are close to zero Solution 2: Clip values. Values larger than 255 become 255 and values less than 0 become 0.  not good if there are many values outside the range. Solution 3: Scaling transformation. Rescale the range to [0,255] by pixel transform. Suppose gL and gH are the lowest and the highest values. (dgn transformasi linier)

Rescaling Intensity 1. Map gL to 0. 2. Map gH to 255. Rescaled value (y) 1. Map gL to 0. 255 2. Map gH to 255. 3. Interpolate for the remaining intensity. Filtered value (x) gL gH

Rescaling: MATLAB Manual: >> gH = max(filtered_image(:)); >> gL = min(filtered_image(:)); >> scaled = (image – gmin)/(gmax – gmin); Note: No need to rescale to 255 because intensity range for double image is [0,1].

Rescaling: MATLAB (2) Command: mat2gray Syntax: mat2gray(double_image); What this command do? scale the value in double_image to displayable value. Output is double type. minimum value is mapped to 0. maximum value is mapped to 1.

Low Pass Filter Averaging Smoothing

Low Pass Filter Useful for reducing noise and eliminating small details. The elements of the mask must be positive. Sum of mask elements is 1 (after normalization). Gaussian

Low Pass Filter : Averaging

Filter Average Filter average penting dalam permasalahan-permasalahan di mana aspek citra yang menjadi perhatian adalah bukan detail citra objek pengamatan : berapa jumlah objek yang ada pada citra luas daerah gelap dan daerah terang pada citra. Ex : template matching

Low Pass Filter : Averaging Mask size determines the degree of smoothing (loss of detail). original 3x3 5x5 7x7 15x15 25x25

Low Pass Filter : Averaging Mask size determines the degree of smoothing (loss of detail). filter average ukuran 15 x 15

Low Pass Filter : Gaussian 1D Gaussian filter: 2D Gaussian filter: http://www-mmdb.iai.uni-bonn.de/lehre/BIT/ss03_DSP_Vorlesung/matlab_demos/ http://upload.wikimedia.org/wikipedia/su/thumb/3/38/Gaussian-pdf.png/300px-Gaussian-pdf.png

Low Pass Filter : Gaussian σ (sigma) controls the amount of smoothing As σ increases, more samples must be obtained to represent the Gaussian function accurately. σ = 3 σ = 1.4

Low Pass Filter : Gaussian Implementasinya : membangun filter Gaussian, mengalikannya dengan matriks hasil transformasi Fourier, dan menginversikan hasilnya. Filter Gaussian merupakan jenis filter yang “paling smooth” dan filter ideal merupakan filter yang “paling tidak smooth”. Sedangkan filter Butterworth berada diantara keduanya.

Benefits of Gaussian Filter They are mathematically very well behaved. The Fourier transform of a Gaussian filter is another Gaussian. There are rotationally symmetric, so are very good starting points for some edge-detection algorithms. They are separable in x and y axes. This can lead to very fast implementations. The convolution of two Gaussians is another Gaussian.

Low Pass Filter : Gaussian Effect of Gaussian filter = blurring larger leads to more blur.  average filter

Averaging vs Gaussian Smoothing

Gaussian Filter: MATLAB Construction of Gaussian filter: command: fspecial(‘gaussian’, size, gamma); size : size of the filter [row column], default [3 3] gamma : , default 0.5. >>gaussian1 = fspecial(‘gaussian’, [5 5], 5); Create the 55 Gaussian filter with the  value of 5. >>gaussian2 = fspecial(‘gaussian’, 3, 0.75);  Create the 33 Gaussian filter with the  value of 0.75. TRY !!

High Pass Filter Edge Sharpening

High Pass Filter Useful for highlighting fine details. The elements of the mask contain both positive and negative weights. Sum of mask elements is 0. 1st derivative of Gaussian 2nd derivative

Edge Sharpening Also known as edge enhancement, edge crispening, unsharp masking. Process to make the edge slightly sharper (tajam) and crisper (tegas). E.g. linear edge sharpening, unsharp masking, high boost filtering High pass filter (HPF) Increase the edge power Example:

High Pass Filter : MATLAB Command: filter2 Syntax: filter2(filter, image, shape); filter2(filter, image); shape: ‘same’: pad edge with zeros. Size unchanged. (default) ‘valid’: apply mask only to inside pixel. Size smaller. ‘full’: pad edge with zeros and applying the filter at all places on and around the image where the mask intersects the image matrix. Size larger. TRY !!

LPF - HPF TRY !! LPF = perbedaan warna rendah HPF = perbedaan warna tinggi atau signifikan TRY !!

Unsharp Masking and High Boost Filter

Unsharp Masking

Unsharp Masking Obtain a sharp image by subtracting a lowpass filtered (i.e., smoothed) image from the original image: - = (after contrast enhancement)

Unsharp Filter [unsharp_image] = [input] – (a [filter]  [input]) = (I* – a [filter])  [input] = [unsharp_filter]  [input] I* : matrix whose center member is 1 and the others are zero. E.g. for 3  3 matrix I* = For 33 matrix, after some rearranging term: [unsharp_filter] = MATLAB use this format with the default  of 0.2.

Unsharp Filter: MATLAB Command: fspecial Syntax: fspecial(‘unsharp’, alpha); alpha : alpha value for unsharp filter Size of the filter is fixed to 3  3 TRY !!

Effect of Unsharp Masking BEFORE AFTER http://ise.hansung.ac.kr/jun/DI/Chapter-5.htm

High Boost Filter (A-1) + = Image sharpening emphasizes edges but low frequency components are lost. (menekankan ketajaman) High boost filter: amplify input image, then subtract a lowpass image. Best result when 3/5  A  5/6 Used in dark image. Boost the intensity of the original image. (A-1) + =

Effect of High Boost Filter BEFORE AFTER A = 5/6 = 0.8333 AFTER A = 1.9

High Boost Filter : MATLAB TRY AT HOME !!

Image Gradient Edge Detection

Image Derivatives : : How can we differentiate a digital image F[x,y]? Option 1: reconstruct a continuous image, f, then compute the derivative Option 2: take discrete derivative (finite difference) How would you implement this as a linear filter? 1 -1 -1 1 : :

Image Gradient The gradient of an image: The gradient points in the direction of most rapid increase in intensity The edge strength is given by the gradient magnitude (besar gradient): The gradient direction is given by: how does this relate to the direction of the edge (arah gradient)?

Image Gradient

Metode Robert adalah teknik differensial pada arah horisontal dan differensial pada arah vertikal, dengan ditambahkan proses konversi biner setelah dilakukan differensial. Maksud konversi biner adalah meratakan distribusi warna hitam dan putih.

Image Gradient A different approximation of the gradient: good approximation (x+1/2,y+1/2) * We can implement and using the following masks:

Metode Prewitt Metode Prewitt merupakan pengembangan metode robert dengan menggunakan filter HPF yang diberi satu angka nol penyangga. Metode ini mengambil prinsip dari fungsi laplacian yang dikenal sebagai fungsi untuk membangkitkan HPF.

Metode Sobel Metode ini mengambil prinsip dari fungsi laplace dan gaussian yang dikenal sebagai fungsi untuk membangkitkan HPF, dan kelebihan dari metode sobel ini adalah mengurangi noise sebelum melakukan perhitungan deteksi tepi.

Image Gradient : MATLAB Command: fspecial Syntax: fspecial(‘prewitt’); fspecial (‘sobel’); TRY !!