Sampling and ReconstructionCamera SimulationImagers = Signal SamplingDisplays = Signal ReconstructionSampling in Computer GraphicsJaggiesSlide 7Fourier TransformsSpatial and Frequency DomainConvolutionSlide 11Sampling: Spatial DomainSampling: Frequency DomainReconstruction: Frequency DomainReconstruction: Spatial DomainSlide 16Sampling TheoremSlide 18Undersampling: AliasingSampling a “Zone Plate”Ideal ReconstructionSlide 22Mitchell Cubic FilterSlide 24Antialiasing by PrefilteringAntialiasingUniform SupersamplingPoint vs. SupersampledAnalytic vs. SupersampledDistribution of Extrafoveal ConesNon-uniform SamplingJittered SamplingJittered vs. Uniform SupersamplingAnalysis of JitterPoisson Disk SamplingCS348B Lecture 8 Pat Hanrahan, Spring 2005Sampling and ReconstructionThe sampling and reconstruction processReal world: continuousDigital world: discreteBasic signal processingFourier transformsThe convolution theoremThe sampling theoremAliasing and antialiasingUniform supersamplingNonuniform supersamplingCS348B Lecture 8 Pat Hanrahan, Spring 2005Camera SimulationSensor response LensShutterScene radiancel w w l l w lW L= �� � � � � � �����rr( , ) ( , , ) ( ( , , ), , ) ( )A TR P x S x t L T x t dA x d dt dw w l=� �( , ) ( , , )x T xl�( , )P x( , , , )L x tw lw� �( , , )S x tw l� �( , , , )L x tw l( , , , )L x tAWCS348B Lecture 8 Pat Hanrahan, Spring 2005Imagers = Signal SamplingAll imagers convert a continuous image to a discrete sampled image by integrating over the active “area” of a sensor.Examples:Retina: photoreceptorsCCD arrayVirtual CG cameras do not integrate,they simply sample radiance along rays …( , , ) ( ) ( )cosT AR L x t P x S t dA d dtw q wW=�����CS348B Lecture 8 Pat Hanrahan, Spring 2005Displays = Signal ReconstructionAll physical displays recreate a continuous image from a discrete sampled image by using a finite sized source of light for each pixel.Examples:DACs: sample and holdCathode ray tube: phosphor spot and gridDACCRTCS348B Lecture 8 Pat Hanrahan, Spring 2005Sampling in Computer GraphicsArtifacts due to sampling - AliasingJaggiesMoireFlickering small objectsSparkling highlightsTemporal strobingPreventing these artifacts - AntialiasingCS348B Lecture 8 Pat Hanrahan, Spring 2005JaggiesRetort sequence by Don MitchellStaircase pattern or jaggiesBasic Signal ProcessingCS348B Lecture 8 Pat Hanrahan, Spring 2005Fourier TransformsSpectral representation treats the function as a weighted sum of sines and cosinesEach function has two representationsSpatial domain - normal representationFrequency domain - spectral representationThe Fourier transform converts between the spatial and frequency domainSpatialDomainFrequencyDomain( ) ( )1( ) ( )2i xi xF f x e dxf x F e dwwww wp�-- ��- �==��CS348B Lecture 8 Pat Hanrahan, Spring 2005Spatial and Frequency DomainSpatial Domain Frequency DomainCS348B Lecture 8 Pat Hanrahan, Spring 2005ConvolutionDefinitionConvolution Theorem: Multiplication in the frequency domain is equivalent to convolution in the space domain.Symmetric Theorem: Multiplication in the space domain is equivalent to convolution in the frequency domain.f g F Gī�f g F G� � �( ) ( ) ( )h x f g f x g x x dx� � �= � = -�The Sampling TheoremCS348B Lecture 8 Pat Hanrahan, Spring 2005Sampling: Spatial DomainIII( ) ( )nnx x nTd=�=- �= -�CS348B Lecture 8 Pat Hanrahan, Spring 2005Sampling: Frequency DomainIII( ) ( )nsnnw d w w=�=- �= -�1 22s s sfT Tpw p= = =CS348B Lecture 8 Pat Hanrahan, Spring 2005Reconstruction: Frequency Domain12121II( )0xxx���=�>��CS348B Lecture 8 Pat Hanrahan, Spring 2005Reconstruction: Spatial Domainsinsincxxxpp=CS348B Lecture 8 Pat Hanrahan, Spring 2005Sampling and Reconstruction�CS348B Lecture 8 Pat Hanrahan, Spring 2005Sampling TheoremThis result if known as the Sampling Theorem and is due to Claude Shannon who first discovered it in 1949A signal can be reconstructed from its sampleswithout loss of information, if the original signal has no frequencies above 1/2 the Sampling frequencyFor a given bandlimited function, the rate at which it must be sampled is called the Nyquist FrequencyAliasingCS348B Lecture 8 Pat Hanrahan, Spring 2005Undersampling: Aliasing��==CS348B Lecture 8 Pat Hanrahan, Spring 2005Sampling a “Zone Plate”2 2sin x y+yxZone plate:Sampled at 128x128Reconstructed to 512x512 Using a 30-wide Kaiser windowed sinc Left rings: part of signalRight rings: prealiasingCS348B Lecture 8 Pat Hanrahan, Spring 2005Ideal ReconstructionIdeally, use a perfect low-pass filter - the sinc function - to bandlimit the sampled signal and thus remove all copies of the spectra introduced by samplingUnfortunately, The sinc has infinite extent and we must use simpler filters with finite extents. Physical processes in particular do not reconstruct with sincsThe sinc may introduce ringing which are perceptually objectionableCS348B Lecture 8 Pat Hanrahan, Spring 2005Sampling a “Zone Plate”2 2sin x y+yxZone plate:Sampled at 128x128Reconstructed to 512x512Using optimal cubic Left rings: part of signalRight rings: prealiasingMiddle rings: postaliasingCS348B Lecture 8 Pat Hanrahan, Spring 2005Mitchell Cubic Filter3 23 2(12 9 6 ) ( 18 12 6 ) (6 2 ) 11( ) ( 6 ) (6 30 ) ( 12 48 ) (8 24 ) 1 260B C x B C x B xh x B C x B C x B C x B C xotherwise�- - + - + + + - <�= - - + + + - - + + < <���Properties:( ) 1nnh x=�=- �=�From Mitchell and NetravaliB-spline: (1,0)Catmull-Rom: (0,1/ 2)Good: (1/ 3,1/ 3)AntialiasingCS348B Lecture 8 Pat Hanrahan, Spring 2005Antialiasing by Prefiltering��==Frequency SpaceCS348B Lecture 8 Pat Hanrahan, Spring 2005AntialiasingAntialiasing = Preventing aliasing1. Analytically prefilter the signalSolvable for points, lines and polygonsNot solvable in generale.g. procedurally defined images2. Uniform supersampling and resample3. Nonuniform or stochastic samplingCS348B Lecture 8 Pat Hanrahan, Spring 2005Uniform SupersamplingIncreasing the sampling rate moves each copy of the spectra further apart, potentially reducing the overlap and thus aliasingResulting samples must be resampled (filtered) to image sampling rateSamples Pixels ssPixel w Sample= ��CS348B Lecture 8 Pat Hanrahan, Spring 2005Point vs. SupersampledPoint 4x4 SupersampledCheckerboard sequence by Tom DufCS348B Lecture 8 Pat Hanrahan, Spring
View Full Document