Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran COMPUTER VISION D10K-7C02 CV04: Image FIltering Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Motion illusion, rotating snakes
Dari 3D ke 2D
Recognition Concept
Image Filtering Compute function of local neighborhood at each position Usage Enhance images Denoise, resize, increase contrast, etc. Extract information from images Texture, edges, distinctive points, etc. Detect patterns Template matching
Image Filtering Types Image filters in spatial domain Filter is a mathematical operation of a grid of numbers Smoothing, sharpening, measuring texture Image filters in the frequency domain Filtering is a way to modify the frequencies of images Denoising, sampling, image compression Templates and Image Pyramids Filtering is a way to match a template to the image Detection, coarse-to-fine registration
Filter What does it do? Box filter Replaces each pixel with an average of its neighborhood Achieve smoothing effect (remove sharp features 1
Image Filtering Operation 1
Image Filtering Operation 1 90 90 ones, divide by 9 Credit: S. Seitz
Image Filtering Operation 1 90 90 10 ones, divide by 9 Credit: S. Seitz
Image Filtering Operation 1 90 90 10 20 ones, divide by 9 Credit: S. Seitz
Image Filtering Operation 1 90 90 10 20 30 ones, divide by 9 Credit: S. Seitz
Image Filtering Operation 1 90 10 20 30
Image Filtering Operation 1 90 10 20 30 ?
Image Filtering Operation 1 90 10 20 30 50 ? Credit: S. Seitz
Image Filtering Operation 1 90 10 20 30 40 60 90 50 80 Credit: S. Seitz
Image Filtering Example
Linear Filter 1 ? Original
Linear Filter 1 Original Filtered (no change)
Linear Filter 1 ? Original
Linear Filter 1 Original Shifted left By 1 pixel
Linear Filter - 2 1 ? (Note that filter sums to 1) Original
- Linear Filter 2 1 Original Sharpening filter 2 1 Original Sharpening filter Accentuates differences with local average
Sharpening
Other Filter -1 -2 1 2 Sobel Horizontal Edge (absolute value)
Filtering vs Convolution
Gaussian FIlter 0.003 0.013 0.022 0.013 0.003 0.013 0.059 0.097 0.059 0.013 0.022 0.097 0.159 0.097 0.022 5 x 5, = 1
Example of Gaussian Filter
Median Filter operates over a window by selecting the median intensity in the window. What advantage does a median filter have over a mean filter? Is a median filter a kind of convolution?
Salt and Pepper Noise Removal by Mean filter Gaussian filter Median filter
Measuring Image Quality Image quality is a characteristic of an image that measures the perceived image degradation (typically, compared to an ideal or perfect image). Measurement tools PNSR Peak to Signal Noise Ration
Illustration PNSR
Demo Filter
Exercise Write down a 3x3 filter that returns a positive value if the average value of the 4-adjacent neighbors is less than the center and a negative value otherwise Write down a filter that will compute the gradient in the x-direction: gradx(y,x) = im(y,x+1)-im(y,x) for each x, y
3. Fill in the blanks: a) _ = D * B b) A = _ * _ c) F = D * _ Filtering Operator a) _ = D * B b) A = _ * _ c) F = D * _ d) _ = D * D 3. Fill in the blanks: A B E G C F D H I