The Frequency DomainSlide 2Slide 3Slide 4A nice set of basisJean Baptiste Joseph Fourier (1768-1830)A sum of sinesFourier TransformTime and FrequencySlide 10Frequency SpectraSlide 12Slide 13Slide 14Slide 15Slide 16Slide 17Slide 18Slide 19Extension to 2DFourier analysis in imagesSignals can be composedMan-made SceneCan change spectrum, then reconstructLow and High Pass filteringThe Convolution Theorem2D convolution theorem exampleSlide 28Slide 29Slide 30Fourier Transform pairsLow-pass, Band-pass, High-pass filtersEdges in imagesWhat does blurring take away?Slide 35High-Pass filterBand-pass filteringLaplacian PyramidWhy Laplacian?Project 1g: Hybrid ImagesClues from Human PerceptionFrequency Domain and PerceptionUnsharp MaskingFreq. Perception Depends on ColorLossy Image Compression (JPEG)Using DCT in JPEGImage compression using DCTJPEG Compression SummaryBlock size in JPEGJPEG compression comparisonImage gradientEffects of noiseSolution: smooth firstDerivative theorem of convolutionLaplacian of Gaussian2D edge detection filtersTry this in MATLABThe Frequency Domain15-463: Computational PhotographyAlexei Efros, CMU, Fall 2011Somewhere 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 univariate 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 (mostly) true!•called Fourier Series•there are some subtle restrictions...the manner in which the author arrives at these equations is not exempt of difficulties and...his analysis to integrate them still leaves something to be desired on the score of generality and even rigour.LaplaceLagrangeLegendreA 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 )()(tan1RIWe 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 )kA ktkp�=�Frequency SpectraFrequency SpectraExtension to 2Din Matlab, check out: imagesc(log(abs(fftshift(fft2(im)))));Fourier analysis in imagesIntensity ImageFourier Imagehttp://sharp.bu.edu/~slehar/fourier/fourier.html#filteringSignals can be composed+ =http://sharp.bu.edu/~slehar/fourier/fourier.html#filteringMore: http://www.cs.unm.edu/~brayer/vision/fourier.htmlMan-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][F111hggh2D convolution theorem example*f(x,y)h(x,y)g(x,y)|F(sx,sy)||H(sx,sy)||G(sx,sy)|Why does the Gaussian give a nice smooth image, but the square filter give edgy artifacts?Gaussian Box filterFilteringGaussianBox FilterFourier 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 functionProject 1g: Hybrid Imageshttp://www.cs.illinois.edu/class/fa10/cs498dwh/projects/hybrid/ComputationalPhotography_ProjectHybrid.htmlGaussian Filter!Laplacian Filter!Project Instructions: A. Oliva, A. Torralba, P.G. Schyns, “Hybrid Images,” SIGGRAPH 2006Gaussianunit impulseLaplacian of GaussianEarly processing in humans filters for various orientations and scales of frequencyPerceptual cues in the mid frequencies dominate perceptionWhen we see an image from far away, we are effectively subsampling itEarly Visual Processing: Multi-scale edge and blob filtersClues from Human PerceptionFrequency Domain and PerceptionFrequency Domain and PerceptionCampbell-Robson contrast sensitivity curveCampbell-Robson contrast sensitivity curveUnsharp Masking200 400 600 800100200300400500-==+ Freq. Perception Depends 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 DCTQuantize •More coarsely for high frequencies (which also tend to have smaller values)•Many quantized high frequency values will be zeroEncode•Can decode with inverse dctQuantization tableFilter responsesQuantized valuesJPEG Compression SummarySubsample color by factor of 2•People have bad resolution for colorSplit into blocks (8x8, typically), subtract 128For each blocka. Compute DCT coefficients forb. Coarsely quantize–Many high frequency components will become zeroc. Encode (e.g., with Huffman coding)http://en.wikipedia.org/wiki/YCbCrhttp://en.wikipedia.org/wiki/JPEGBlock size in JPEG Block size•small block–faster
View Full Document