This preview shows page 1-2-3-4-5-6-7-50-51-52-53-54-55-56-100-101-102-103-104-105-106 out of 106 pages.
Image Blending and Compositing15-463: Computational PhotographyAlexei Efros, CMU, Fall 2011© NASAImage CompositingCompositing Procedure1. Extract Sprites (e.g using Intelligent Scissors in Photoshop)Composite by David Dewey2. Blend them into the composite (in the right order)Need blendingAlpha Blending / Feathering0101+=Iblend= αIleft+ (1-α)IrightAffect of Window Size01leftright01Affect of Window Size0101Good Window Size01“Optimal” Window: smooth but not ghostedWhat is the Optimal Window?To avoid seams• window = size of largest prominent featureTo avoid ghosting• window <= 2*size of smallest prominent featureNatural to cast this in the Fourier domain• largest frequency <= 2*size of smallest frequency• image frequency content should occupy one “octave” (power of two)FFTWhat if the Frequency Spread is WideIdea (Burt and Adelson)• Compute Fleft= FFT(Ileft), Fright= FFT(Iright)• Decompose Fourier image into octaves (bands)– Fleft= Fleft1+ Fleft2+ …• Feather corresponding octaves Fleftiwith Frighti– Can compute inverse FFT and feather in spatial domain• Sum feathered octave images in frequency domainBetter implemented in spatial domainFFTOctaves in the Spatial DomainBandpass ImagesLowpass ImagesPyramid Blending010101Left pyramid Right pyramidblendPyramid Blendinglaplacianlevel4laplacianlevel2laplacianlevel0left pyramid right pyramid blended pyramidLaplacian Pyramid: BlendingGeneral Approach:1. Build Laplacian pyramids LA and LB from images A and B2. Build a Gaussian pyramid GR from selected region R3. Form a combined pyramid LS from LA and LB using nodes of GR as weights:• LS(i,j) = GR(I,j,)*LA(I,j) + (1-GR(I,j))*LB(I,j)4. Collapse the LS pyramid to get the final blended imageBlending RegionsHorror Photo© david dmartin (Boston College)Results from this class (fall 2005)© Chris CameronSeason Blending (St. Petersburg)Season Blending (St. Petersburg)Simplification: Two-band BlendingBrown & Lowe, 2003• Only use two bands: high freq. and low freq.• Blends low freq. smoothly• Blend high freq. with no smoothing: use binary alphaLow frequency (λ > 2 pixels)High frequency (λ < 2 pixels)2-band BlendingLinear Blending2-band BlendingDon’t blend, CUT!So far we only tried to blend between two images. What about finding an optimal seam?Moving objects become ghostsDavis, 1998Segment the mosaic• Single source image per segment• Avoid artifacts along boundries– Dijkstra’s algorithmmin. error boundaryMinimal error boundaryoverlapping blocks vertical boundary__==22overlap errorSeam Carvinghttp://www.youtube.com/watch?v=6NcIJXTlugcGraphcutsWhat if we want similar “cut-where-things-agree” idea, but for closed regions?• Dynamic programming can’t handle loopsGraph cuts – a more general solutionn-linkssta cuthard constrainthard constraintMinimum cost cut can be computed in polynomial time(max-flow/min-cut algorithms)Kwatra et al, 2003Actually, for this example, DP will work just as well…Lazy SnappingInteractive segmentation using graphcutsGradient DomainIn Pyramid Blending, we decomposed our image into 2ndderivatives (Laplacian) and a low-res imageLet us now look at 1stderivatives (gradients):• No need for low-res image – captures everything (up to a constant)• Idea: – Differentiate– Blend / edit / whatever– ReintegrateGradient Domain blending (1D)TwosignalsRegularblendingBlendingderivativesbrightdarkGradient Domain Blending (2D)Trickier in 2D:• Take partial derivatives dx and dy (the gradient field)• Fidle around with them (smooth, blend, feather, etc)• Reintegrate– But now integral(dx) might not equal integral(dy)• Find the most agreeable solution– Equivalent to solving Poisson equation– Can be done using least-squaresPerez et al., 2003Perez et al, 2003Limitations:• Can’t do contrast reversal (gray on black -> gray on white)• Colored backgrounds “bleed through”• Images need to be very well alignededitingGradients vs. PixelsCan we use this for range compression?White?White?White?Thinking in Gradient DomainOur very own Jim McCann::James McCannReal-Time Gradient-Domain Painting, SIGGRAPH 2009Gradient Domain as Image RepresentationSee GradientShop paper as good example:http://www.gradientshop.com/ Can be used to exert high-level control over images Can be used to exert high-level control over imagesgradients – low level image-features Can be used to exert high-level control over imagesgradients – low level image-features+100pixelgradient Can be used to exert high-level control over imagesgradients – low level image-featuresgradients – give rise to high level image-features+100pixelgradient Can be used to exert high-level control over imagesgradients – low level image-featuresgradients – give rise to high level image-features+100+100+100+100+100+100pixelgradient+100+100+100+100+100+100pixelgradient Can be used to exert high-level control over imagesgradients – low level image-featuresgradients – give rise to high level image-features+100+100+100+100+100+100pixelgradient+100+100+100+100+100+100pixelgradientimage edgeimage edge Can be used to exert high-level control over imagesgradients – low level image-featuresgradients – give rise to high level image-featuresmanipulate local gradients to manipulate global image interpretation+100+100+100+100+100+100pixelgradient+100+100+100+100+100+100pixelgradient Can be used to exert high-level control over imagesgradients – low level image-featuresgradients – give rise to high level image-featuresmanipulate local gradients to manipulate global image interpretation+255+255+255+255+255pixelgradient Can be used to exert high-level control over imagesgradients – low level image-featuresgradients – give rise to high level image-featuresmanipulate local gradients to manipulate global image interpretation+255+255+255+255+255pixelgradient Can be used to exert high-level control over imagesgradients – low level image-featuresgradients – give rise to high level image-featuresmanipulate local gradients to manipulate global image interpretation+0+0+0+0+0pixelgradient Can be used to exert high-level control over imagesgradients – low level image-featuresgradients – give rise to high level image-featuresmanipulate local gradients to manipulate global image interpretation+0+0+0+0+0pixelgradient Can be used to exert high-level control over
View Full Document