The Frequency DomainSlide Number 2Slide Number 3Slide Number 4A nice set of basisJean Baptiste Joseph Fourier (1768-1830)A sum of sinesFourier TransformTime and FrequencyTime and FrequencyFrequency SpectraFrequency SpectraFrequency SpectraFrequency SpectraFrequency SpectraFrequency SpectraFrequency SpectraFrequency SpectraFrequency SpectraExtension to 2DMan-made SceneCan change spectrum, then reconstructLow and High Pass filteringThe Convolution Theorem2D convolution theorem exampleFourier Transform pairsLow-pass, Band-pass, High-pass filtersEdges in imagesWhat does blurring take away?What does blurring take away?High-Pass filterBand-pass filteringLaplacian PyramidWhy Laplacian?Unsharp MaskingImage gradientEffects of noiseSolution: smooth firstDerivative theorem of convolutionLaplacian of Gaussian2D edge detection filtersTry this in MATLABCampbell-Robson contrast sensitivity curveDepends on ColorLossy Image Compression (JPEG)Using DCT in JPEG Image compression using DCTBlock size in JPEG JPEG compression comparisonThe Frequency Domain15-463: Computational PhotographyAlexei Efros, CMU, Fall 2008Somewhere in Cinque Terre, May 2005Many slides borrowed from Steve SeitzSalvador Dali“Gala Contemplating the Mediterranean Sea, which at 30 meters becomes the portrait of Abraham Lincoln”, 1976A nice set of basisThis change of basis has a special name…Teases away fast vs. slow changes in the image.Jean Baptiste Joseph Fourier (1768-1830)had crazy idea (1807):Any periodic function can be rewritten as a weighted sum of sines and cosines of different frequencies. Don’t believe it? • Neither did Lagrange, Laplace, Poisson and other big wigs• Not translated into English until 1878!But it’s true!• called Fourier SeriesA sum of sinesOur building block:Add enough of them to get any signal f(x) you want!How many degrees of freedom?What does each control?Which one encodes the coarse vs. fine structure of the signal?)+φωxAsin(Fourier TransformWe want to understand the frequency ω of our signal. So, let’s reparametrize the signal by ωinstead of x:)+φωxAsin(f(x)F(ω)Fourier TransformF(ω)f(x)Inverse Fourier TransformFor every ωfrom 0 to inf, F(ω) holds the amplitude A and phase φ of the corresponding sine • How can F hold both? Complex number trick!)()()(ωωωiIRF+=22)()(ωωIRA +±=)()(tan1ωωφRI−=We can always go back:Time and Frequencyexample : g(t) = sin(2pf t) + (1/3)sin(2p(3f) t)Time and Frequencyexample : g(t) = sin(2pf t) + (1/3)sin(2p(3f) t)= +Frequency Spectraexample : g(t) = sin(2pf t) + (1/3)sin(2p(3f) t)= +Frequency SpectraUsually, frequency is more interesting than the phase= += Frequency Spectra= += Frequency Spectra= += Frequency Spectra= += Frequency Spectra= += Frequency Spectra= 11sin(2 )kAktkπ∞=∑Frequency SpectraFrequency SpectraExtension to 2Din Matlab, check out: imagesc(log(abs(fftshift(fft2(im)))));Man-made SceneCan change spectrum, then reconstructLow and High Pass filteringThe Convolution TheoremThe greatest thing since sliced (banana) bread!• 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• Convolution in spatial domain is equivalent to multiplication in frequency domain!]F[]F[]F[ hghg=∗][F][F][F111hggh−−−∗=2D convolution theorem example*f(x,y)h(x,y)g(x,y)|F(sx ,sy )||H(sx ,sy )||G(sx ,sy )|Fourier Transform pairsLow-pass, Band-pass, High-pass filterslow-pass:High-pass / band-pass:Edges in imagesWhat does blurring take away?originalWhat does blurring take away?smoothed (5x5 Gaussian)High-Pass filtersmoothed – originalBand-pass filteringLaplacian Pyramid (subband images)Created from Gaussian pyramid by subtractionGaussian Pyramid (low-pass images)Laplacian PyramidHow can we reconstruct (collapse) this pyramid into the original image?Need this!OriginalimageWhy Laplacian?Laplacian of GaussianGaussiandelta functionUnsharp Masking-==+ αImage gradientThe gradient of an image: The gradient points in the direction of most rapid change in intensityThe gradient direction is given by:• how does this relate to the direction of the edge?The edge strength is given by the gradient magnitudeEffects of noiseConsider a single row or column of the image• Plotting intensity as a function of position gives a signalWhere is the edge?How to compute a derivative?Where is the edge? Solution: smooth firstLook for peaks inDerivative theorem of convolutionThis saves us one operation:Laplacian of GaussianConsider Laplacian of GaussianoperatorWhere is the edge?Zero-crossings of bottom graph2D edge detection filtersis the Laplacian operator:Laplacian of GaussianGaussian derivative of GaussianTry this in MATLABg = fspecial('gaussian',15,2);imagesc(g); colormap(gray);surfl(g)gclown = conv2(clown,g,'same');imagesc(conv2(clown,[-1 1],'same'));imagesc(conv2(gclown,[-1 1],'same'));dx = conv2(g,[-1 1],'same');imagesc(conv2(clown,dx,'same'));lg = fspecial('log',15,2);lclown = conv2(clown,lg,'same');imagesc(lclown)imagesc(clown + .2*lclown)CampbellCampbell--Robson contrast sensitivity curveRobson contrast sensitivity curveDepends on ColorRG BLossy Image Compression (JPEG)Block-based Discrete Cosine Transform (DCT)Using DCT in JPEG The first coefficient B(0,0) is the DC component, the average intensityThe top-left coeffs represent low frequencies, the bottom right – high frequenciesImage compression using DCTDCT enables image compression by concentrating most image information in the low frequenciesLoose unimportant image info (high frequencies) by cutting B(u,v) at bottom right The decoder computes the inverse DCT – IDCT •Quantization Table3 5 7 9 11 13 15 175 7 9 11 13 15 17 197 9 11 13 15 17 19 219 11 13 15 17 19 21 2311 13 15 17 19 21 23 2513 15 17 19 21 23 25 2715 17 19 21 23 25 27 2917 19 21 23 25 27 29 31Block size in JPEG Block size• small block– faster – correlation exists between neighboring pixels• large block– better compression in smooth regions• It’s 8x8 in standard JPEGJPEG compression comparison89k
View Full Document