Immagini e filtri lineari. Image Filtering Modifying the pixels in an image based on some function of a local neighborhood of the pixels 103010 201120.

Slides:



Advertisements
Similar presentations
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Advertisements

Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
3-D Computational Vision CSc Image Processing II - Fourier Transform.
Fourier Transform (Chapter 4)
Pyramids and Texture. Scaled representations Big bars and little bars are both interesting Spots and hands vs. stripes and hairs Inefficient to detect.
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Computer Graphics Recitation 6. 2 Motivation – Image compression What linear combination of 8x8 basis signals produces an 8x8 block in the image?
Convolution, Edge Detection, Sampling : Computational Photography Alexei Efros, CMU, Fall 2006 Some slides from Steve Seitz.
General Functions A non-periodic function can be represented as a sum of sin’s and cos’s of (possibly) all frequencies: F(  ) is the spectrum of the function.
Linear filtering. Overview: Linear filtering Linear filters Definition and properties Examples Gaussian smoothing Separability Applications Denoising.
Introduction to Computer Vision CS / ECE 181B  Handout #4 : Available this afternoon  Midterm: May 6, 2004  HW #2 due tomorrow  Ack: Prof. Matthew.
Computer Vision - A Modern Approach Set: Pyramids and Texture Slides by D.A. Forsyth Scaled representations Big bars (resp. spots, hands, etc.) and little.
Linear Filtering About modifying pixels based on neighborhood. Local methods simplest. Linear means linear combination of neighbors. Linear methods simplest.
Transforms: Basis to Basis Normal Basis Hadamard Basis Basis functions Method to find coefficients (“Transform”) Inverse Transform.
Fourier Analysis : Rendering and Image Processing Alexei Efros.
Basic Image Processing January 26, 30 and February 1.
Most slides from Steve Seitz
Sampling and Antialiasing CMSC 491/635. Abstract Vector Spaces Addition –C = A + B = B + A –(A + B) + C = A + (B + C) –given A, B, A + X = B for only.
CSC589 Introduction to Computer Vision Lecture 9 Sampling, Gaussian Pyramid Bei Xiao.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean 5409 T-R 10:30am – 11:50am.
G52IIP, School of Computer Science, University of Nottingham 1 Image Transforms Fourier Transform Basic idea.
© Chun-Fa Chang Sampling Theorem & Antialiasing. © Chun-Fa Chang Motivations “ My ray traced images have a lot more pixels than the TV screen. Why do.
Topic 7 - Fourier Transforms DIGITAL IMAGE PROCESSING Course 3624 Department of Physics and Astronomy Professor Bob Warwick.
2D Image Fourier Spectrum.
Applications of Image Filters Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/04/10.
EECS 274 Computer Vision Pyramid and Texture. Filter, pyramid and texture Frequency domain Fourier transform Gaussian pyramid Wavelets Texture Reading:
Lecture 03 Area Based Image Processing Lecture 03 Area Based Image Processing Mata kuliah: T Computer Vision Tahun: 2010.
09/19/2002 (C) University of Wisconsin 2002, CS 559 Last Time Color Quantization Dithering.
Lecture 7: Sampling Review of 2D Fourier Theory We view f(x,y) as a linear combination of complex exponentials that represent plane waves. F(u,v) describes.
Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean 5403 T-R 3:00pm – 4:20pm.
Chapter 5: Neighborhood Processing
Sampling Theorem & Antialiasing
Fourier Transform.
Image hole-filling. Agenda Project 2: Will be up tomorrow Due in 2 weeks Fourier – finish up Hole-filling (texture synthesis) Image blending.
Lecture 5: Fourier and Pyramids
2D Fourier Transform.
Filtering (II) Dr. Chang Shu COMP 4900C Winter 2008.
Last Lecture photomatix.com. Today Image Processing: from basic concepts to latest techniques Filtering Edge detection Re-sampling and aliasing Image.
Linear filters. CS8690 Computer Vision University of Missouri at Columbia What is Image Filtering? Modify the pixels in an image based on some function.
Fourier Transform (Chapter 4) CS474/674 – Prof. Bebis.
Digital Image Processing Chapter - 4
Linear Filters and Edges Chapters 7 and 8
… Sampling … … Filtering … … Reconstruction …
Correlation and Convolution They replace the value of an image pixel with a combination of its neighbors Basic operations in images Shift Invariant Linear.
Linear Filtering – Part II
Linear Filters and Edges Chapters 7 and 8
Department of Computer Engineering
(C) 2002 University of Wisconsin, CS 559
General Functions A non-periodic function can be represented as a sum of sin’s and cos’s of (possibly) all frequencies: F() is the spectrum of the function.
Fourier Transform.
All about convolution.
Fourier Transform Analytic geometry gives a coordinate system for describing geometric objects. Fourier transform gives a coordinate system for functions.
Outline Linear Shift-invariant system Linear filters
Fourier Transform Analytic geometry gives a coordinate system for describing geometric objects. Fourier transform gives a coordinate system for functions.
Gaussian Pyramid and Texture
Phase and Amplitude in Fourier Transforms, Meaning of frequencies
Linear filtering.
Lecture 5: Resampling, Compositing, and Filtering Li Zhang Spring 2008
Basic Image Processing
Digital Image Processing Week IV
Most slides from Steve Seitz
Linear Filtering CS 678 Spring 2018.
Department of Computer Engineering
Fourier Transform Analytic geometry gives a coordinate system for describing geometric objects. Fourier transform gives a coordinate system for functions.
Most slides from Steve Seitz
Templates and Image Pyramids
Even Discrete Cosine Transform The Chinese University of Hong Kong
Presentation transcript:

Immagini e filtri lineari

Image Filtering Modifying the pixels in an image based on some function of a local neighborhood of the pixels p N(p) 5.7

Linear Filtering The output is the linear combination of the neighborhood pixels The coefficients of this linear combination combine to form the “filter-kernel” Image Kernel = 5 Filter Output

Convolution H7H7 H8H8 H9H9 H4H4 H5H5 H6H6 H1H1 H2H2 H3H3 H9H9 H8H8 H7H7 H6H6 H5H5 H4H4 H3H3 H2H2 H1H1 H1H1 H2H2 H3H3 H4H4 H5H5 H6H6 H7H7 H8H8 H9H9 I1I1 I2I2 I3I3 I4I4 I5I5 I6I6 I7I7 I8I8 I9I9

Linear Filtering

Gaussian Filter

Linear Filtering(Gaussian Filter)

Gaussian Vs Average Gaussian Smoothing Smoothing by Averaging

Noise Filtering Gaussian Noise After Gaussian Smoothing After Averaging

Noise Filtering Salt & Pepper Noise After Gaussian Smoothing After Averaging

Shift Invariant Linear Systems Superposition Scaling Shift Invariance

Fourier Transform

The Fourier Transform Represent function on a new basis –Think of functions as vectors, with many components –We now apply a linear transformation to transform the basis dot product with each basis element In the expression, u and v select the basis element, so a function of x and y becomes a function of u and v basis elements have the form

Here u & v are larger than the previous slide Larger than the upper example

Cheetah Image Fourier Magnitude (above) Fourier Phase (below)

Zebra Image Fourier Magnitude (above) Fourier Phase (below)

Reconstruction with Zebra phase, Cheetah Magnitude

Reconstruction with Cheetah phase, Zebra Magnitude

Various Fourier Transform Pairs Important facts –The Fourier transform is linear –There is an inverse FT –if you scale the function’s argument, then the transform’s argument scales the other way. This makes sense --- if you multiply a function’s argument by a number that is larger than one, you are stretching the function, so that high frequencies go to low frequencies –The FT of a Gaussian is a Gaussian. The convolution theorem –The Fourier transform of the convolution of two functions is the product of their Fourier transforms –The inverse Fourier transform of the product of two Fourier transforms is the convolution of the two inverse Fourier transforms

Various Fourier Transform Pairs

Aliasing Can’t shrink an image by taking every second pixel If we do, characteristic errors appear –In the next few slides –Typically, small phenomena look bigger; fast phenomena can look slower –Common phenomenon Wagon wheels rolling the wrong way in movies Checkerboards misrepresented in ray tracing Striped shirts look funny on colour television

Resample the checkerboard by taking one sample at each circle. In the case of the top left board, new representation is reasonable. Top right also yields a reasonable representation. Bottom left is all black (dubious) and bottom right has checks that are too big.

Constructing a pyramid by taking every second pixel leads to layers that badly misrepresent the top layer

Sampling in 1D takes a continuous function and replaces it with a vector of values, consisting of the function’s values at a set of sample points. We’ll assume that these sample points are on a regular grid, and can place one at each integer for convenience. Sampling in 1D

Sampling in 2D does the same thing, only in 2D. We’ll assume that these sample points are on a regular grid, and can place one at each integer point for convenience. Sampling in 2D

Convolution

Nyquist Theorem In order for a band-limited (i.e., one with a zero power spectrum for frequencies f > B) baseband ( f > 0) signal to be reconstructed fully, it must be sampled at a rate f  2B. A signal sampled at f = 2B is said to be Nyquist sampled, and f =2B is called the Nyquist frequency. No information is lost if a signal is sampled at the Nyquist frequency, and no additional information is gained by sampling faster than this rate.

Smoothing as low-pass filtering The message of the NT is that high frequencies lead to trouble with sampling. Solution: suppress high frequencies before sampling –multiply the FT of the signal with something that suppresses high frequencies –or convolve with a low- pass filter A filter whose FT is a box is bad, because the filter kernel has infinite support Common solution: use a Gaussian –multiplying FT by Gaussian is equivalent to convolving image with Gaussian.

Sampling without smoothing. Top row shows the images, sampled at every second pixel to get the next; bottom row shows the magnitude spectrum of these images.

Gaussian Filter

Sampling with smoothing. Top row shows the images. We get the next image by smoothing the image with a Gaussian with sigma 1 pixel, then sampling at every second pixel to get the next; bottom row shows the magnitude spectrum of these images.

Sampling with smoothing. Top row shows the images. We get the next image by smoothing the image with a Gaussian with sigma 1.4 pixels, then sampling at every second pixel to get the next; bottom row shows the magnitude spectrum of these images.

Approximate Gaussian

What about 2D? Separability of Gaussian Requires n 2 k 2 multiplications for n by n image and k by k kernel. Requires 2kn 2 multiplications for n by n image and k by k kernel.

Algorithm Apply 1D mask to alternate pixels along each row of image. Apply 1D mask to alternate pixels along each colum of resultant image from previous step.