Interactive image completion with perspective correction Darko Pavi´c Volker Sch¨onefeld Leif Kobbelt Pacific Graphics 2006.

Slides:



Advertisements
Similar presentations
More on single-view geometry
Advertisements

Automatic Color Gamut Calibration Cristobal Alvarez-Russell Michael Novitzky Phillip Marks.
Alignment Visual Recognition “Straighten your paths” Isaiah.
3D reconstruction.
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
November 12, 2013Computer Vision Lecture 12: Texture 1Signature Another popular method of representing shape is called the signature. In order to compute.
Image Segmentation Image segmentation (segmentace obrazu) –division or separation of the image into segments (connected regions) of similar properties.
Segmentation (2): edge detection
3D Skeletons Using Graphics Hardware Jonathan Bilodeau Chris Niski.
Chapter 5 Raster –based algorithms in CAC. 5.1 area filling algorithm 5.2 distance transformation graph and skeleton graph generation algorithm 5.3 convolution.
Instructor: Mircea Nicolescu Lecture 13 CS 485 / 685 Computer Vision.
Image alignment Image from
Workshop on Earth Observation for Urban Planning and Management, 20 th November 2006, HK 1 Zhilin Li & Kourosh Khoshelham Dept of Land Surveying & Geo-Informatics.
Last Time Pinhole camera model, projection
Offset of curves. Alina Shaikhet (CS, Technion)
Uncalibrated Geometry & Stratification Sastry and Yang
CS485/685 Computer Vision Prof. George Bebis
The plan for today Camera matrix
Fitting a Model to Data Reading: 15.1,
MSU CSE 803 Fall 2008 Stockman1 CV: 3D sensing and calibration Coordinate system changes; perspective transformation; Stereo and structured light.
Camera Calibration CS485/685 Computer Vision Prof. Bebis.
A Novel 2D To 3D Image Technique Based On Object- Oriented Conversion.
Abstract Overall Algorithm Target Matching Error Checking: By comparing what we transform from Kinect Camera coordinate to robot coordinate with what we.
Computer Vision Lecture 3: Digital Images
Visualization and graphics research group CIPIC January 21, 2003Multiresolution (ECS 289L) - Winter Surface Simplification Using Quadric Error Metrics.
Part I: Basics of Computer Graphics Rendering Polygonal Objects (Read Chapter 1 of Advanced Animation and Rendering Techniques) Chapter
October 8, 2013Computer Vision Lecture 11: The Hough Transform 1 Fitting Curve Models to Edges Most contours can be well described by combining several.
Curve Modeling Bézier Curves
CSE554Laplacian DeformationSlide 1 CSE 554 Lecture 8: Laplacian Deformation Fall 2012.
Shape Recognition and Pose Estimation for Mobile Augmented Reality Author : N. Hagbi, J. El-Sana, O. Bergig, and M. Billinghurst Date : Speaker.
Surface Simplification Using Quadric Error Metrics Michael Garland Paul S. Heckbert.
October 14, 2014Computer Vision Lecture 11: Image Segmentation I 1Contours How should we represent contours? A good contour representation should meet.
G52IIP, School of Computer Science, University of Nottingham 1 Edge Detection and Image Segmentation.
Intelligent Vision Systems ENT 496 Object Shape Identification and Representation Hema C.R. Lecture 7.
Digital Image Processing CCS331 Relationships of Pixel 1.
Generalized Hough Transform
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
Course 13 Curves and Surfaces. Course 13 Curves and Surface Surface Representation Representation Interpolation Approximation Surface Segmentation.
G52IVG, School of Computer Science, University of Nottingham 1 Edge Detection and Image Segmentation.
Single View Geometry Course web page: vision.cis.udel.edu/cv April 9, 2003  Lecture 20.
Plenoptic Modeling: An Image-Based Rendering System Leonard McMillan & Gary Bishop SIGGRAPH 1995 presented by Dave Edwards 10/12/2000.
CS654: Digital Image Analysis Lecture 25: Hough Transform Slide credits: Guillermo Sapiro, Mubarak Shah, Derek Hoiem.
Wenqi Zhu 3D Reconstruction From Multiple Views Based on Scale-Invariant Feature Transform.
Scene Completion Using Millions of Photographs James Hays, Alexei A. Efros Carnegie Mellon University ACM SIGGRAPH 2007.
Copyright © Cengage Learning. All rights reserved. 16 Vector Calculus.
Distinctive Image Features from Scale-Invariant Keypoints David Lowe Presented by Tony X. Han March 11, 2008.
October 1, 2013Computer Vision Lecture 9: From Edges to Contours 1 Canny Edge Detector However, usually there will still be noise in the array E[i, j],
Auto-calibration we have just calibrated using a calibration object –another calibration object is the Tsai grid of Figure 7.1 on HZ182, which can be used.
1 Overview representing region in 2 ways in terms of its external characteristics (its boundary)  focus on shape characteristics in terms of its internal.
776 Computer Vision Jan-Michael Frahm Spring 2012.
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
Photoconsistency constraint C2 q C1 p l = 2 l = 3 Depth labels If this 3D point is visible in both cameras, pixels p and q should have similar intensities.
Camera Calibration Course web page: vision.cis.udel.edu/cv March 24, 2003  Lecture 17.
Computer Graphics CC416 Lecture 04: Bresenham Line Algorithm & Mid-point circle algorithm Dr. Manal Helal – Fall 2014.
SIFT.
Introduction to Parametric Curve and Surface Modeling.
776 Computer Vision Jan-Michael Frahm Spring 2012.
April 21, 2016Introduction to Artificial Intelligence Lecture 22: Computer Vision II 1 Canny Edge Detector The Canny edge detector is a good approximation.
October 3, 2013Computer Vision Lecture 10: Contour Fitting 1 Edge Relaxation Typically, this technique works on crack edges: pixelpixelpixel pixelpixelpixelebg.
Mean Shift Segmentation
Fitting Curve Models to Edges
Structure from motion Input: Output: (Tomasi and Kanade)
Computer Vision Lecture 9: Edge Detection II
Craig Schroeder October 26, 2004
Chapter V Vertex Processing
SIFT.
Introduction to Parametric Curve and Surface Modeling
Structure from motion Input: Output: (Tomasi and Kanade)
Introduction to Artificial Intelligence Lecture 22: Computer Vision II
Presentation transcript:

Interactive image completion with perspective correction Darko Pavi´c Volker Sch¨onefeld Leif Kobbelt Pacific Graphics 2006

Introduction Fragment-based image completion techniques are a very powerful tool to fill in missing pixel information when removing a foreground object from a digital photo. The conceptual idea is to fill a hole in the image by copying small source fragments from known regions of the image such that they eventually completely cover the undefined region.

Introduction Three mainly aspects of fragment-based completion: The definition of the search space. The selection of the best source fragment is based on a similarity measure. Once the best source fragment is found, it has to be transformed to the target location in the image.

Introduction We present an interactive system for fragment-based image completion which exploits information about the approximate 3D structure in a scene in order to estimate and apply perspective corrections when copying a source fragment to a target position.

Introduction The effect of perspective corrections for image completion. Input image Rectifying homography Rectified space Without perspective correction

Overall system description Our interactive system uses several image buffers as source buffers S( ・, ・ ). When searching for fragments, one buffer is set as the target buffer T( ・, ・ ).

Overall system description The workflow of our system is as follows: After loading the input image(s) the user first paints an α- matte which defines the image regions to be replaced (α = 1). Then user can define a set of 3D planes in the image which are used for rectification. Each rectification generates another image buffer where we can later search for source fragments. The user can further define a set of features in order to preserve these features. The user interactively picks target fragment locations and chooses target fragment sizes. The system finds the best fitting source fragment. By this the unknown region (α = 1) is incrementally filled with fragments.

Image completion with perspective correction Due to their rotational invariance, we prefer to use circular fragments. Assume we had a circular planar fragment in 3D object space which is mapped to an ellipse in image space (the image (a)). Rectifying the supporting plane (the side of the cube) corresponds to aligning the fragment to the camera plane such that it becomes circular in the distorted image (subfigures (b) and (c)).

Image completion with perspective correction Homographies (or 3D planes) are defined by drawing convex quads directly in the image (a). These quads are mapped to rectangles with a user-specified aspect ratio (b, c). Each rectified image serves as an additional image buffer. The quads do not have to bound the rectified region as shown in c.

Image completion with perspective correction In practice it turns out that we do not even have to explicitly restrict the fragment search to the rectified regions since the most similar fragment is usually found in this region anyway. Due to the fact that we are using a FFT based evaluation procedure.

Sketching a homography While the surface of real objects in a 3D scene can often be assumed to be locally planar, their surface orientation is usually not aligned to the image plane of the camera. Hence when copying fragments we have to compensate the perspective distortion by applying a projective transformation. A projective transformation of a plane is essentially a 2D transform, a homography, which can be represented by a 3×3 matrix in homogeneous coordinates.

Sketching a homography The most natural way to define a homography is through a pair of quadrilaterals in image space. The four 2D point correspondences provide the eight constraints by which the nine entries of the 3×3 matrix can be computed up to a constant factor. The user defines just one convex but otherwise general quad while the second quad is restricted to be a rectangle where the user only has to adjust the aspect ratio.

More complex interaction metaphors We implement an interaction metaphor which allows us to define a whole grid of quads Q i, j in an efficient manner. Each of the quads in the grid implies a homography H i, j which rectifies the interior of Q i, j. Putting all these rectified pieces together yields an unfolded orthogonal view of the whole curved surface.

More complex interaction metaphors Quad-Grid interaction metaphor. Curved surfaces can be rectified by defining a regular quad grid as shown in a. Rectifying each quad and putting the resulting rectangles together yields an unfolded orthogonal view of the surface as visualized in b.

More complex interaction metaphors It is quite difficult to position the vertices with a sufficient precision such that the rectified image is a continuous deformation of the input image. The reason for this difficulty is that even if the homographies H i, j are defined by the common corners {p i, j, p i+1, j, p i, j+1, p i+1, j+1 } of the quads Q i, j there is no guarantee that the homographies of two neighboring quads, H i, j−1 and H i, j coincide on the whole common boundary edge p i, j p i+1, j.

More complex interaction metaphors Quad-Grid relaxation. (a)shows the initial constellation of the quad-grid points. (b)The piecewise homographies cause discontinuities at the common boundaries. (c) visualizes the same constellation after our relaxation procedure which eliminates the discontinuities as shown in d.

More complex interaction metaphors To make the quad grid metaphor less sensitive, we derive a snapping mechanism. For simplicity let us assume that the rectified quads are squares, i.e., H i, j (Q i, j ) = [i, i +1]×[ j, j+1]. Since by construction neighboring homographies H i, j−1 and H i, j coincide at the common corner points p i, j and p i+1, j, we can measure the inconsistency by looking at how strongly the two mappings deviate at the mid-point of the common edge.

More complex interaction metaphors Quad-Grid snapping. Midpoints of neighboring squares in rectified space (circles in the right image) are not necessarily mapped to the same point in image space (depicted by the half-circles on the left). Our snapping technique searches for the best update of each grid-point pi, j in order to minimize the sum of midpoint deviations.

More complex interaction metaphors Because our snapping mechanism adjusts the positions of the grid vertices p i, j, it is better to compute the deviation in image space and to consider the inverse homographies H −1 i, j which map unit squares [i, i +1]×[ j, j +1] to image quads Q i, j. For these the mid-point deviation on the edge p i, j p i+1, j is computed by ||H −1 i, j−1 (i + 1/2, j)− H −1 i, j (i + 1/2, j)||. For a given grid point p i, j we can sum up these mid- point deviations for all adjacent edges p i, j p i±1, j±1 which gives us a quality score for this vertex.

Feature handling We use a pixel-based approach which nicely fits into our FFT-based computation without causing significant overhead. In our setting a feature is an arbitrary set of pixels that can even consist of several connected components. To define a feature, the user simply draws lines or freehand curves onto the image or paints complete regions. For each feature we compute a distance map where every pixel stores its Euclidian distance to the nearest feature pixel. During the source fragment search, we take the feature information into account by treating it as an additional (color) channel of the buffer.

Implementation Checking fragment validity The first validity check is trivially satisfied by restricting the source fragments to a region which is sufficiently far away from the source buffer boundary. For circular fragments with radius r we have to stay 2r pixels away from the lower and right boundaries.

Implementation Checking fragment validity The upper row shows the validity check for source fragments as a convolution operation. The lower row shows how the one-sided feature distance is computed by convolving the fragment feature mask with the feature distance map of the buffer.

Implementation Checking fragment validity The second validity check can be implemented as another convolution operation and hence FFT can be exploited again. We take the α matte of the source buffer as the first buffer with α(u, v) = 1 in undefined regions and zero everywhere else. For the second buffer we set β(u, v) = 1 in all pixels which belong to the interior of the flipped and padded target fragment and zero everywhere else.

Implementation Feature handling For each feature defined by the user, the image buffers are augmented by an additional buffer D( ・, ・ ), which stores the distance map of that feature. From the distance map of the feature channel of the target fragment we extract the binary feature pixel mask X(u,v)( ・, ・ ) by thresholding:

Implementation Feature handling After flipping and padding this binary mask, we obtain a buffer Xˆ( ・, ・ ) whose convolution with D( ・, ・ ) yields the one sided distances for each source fragment candidate. Finally, in order to preserve features, we discard all source fragments whose two-sided feature distance measure (normalized by the number of feature pixels) is above a given tolerance h. We generally set this tolerance to 5% of the fragment radius.

Implementation Composition Gradient correction. a shows a target fragment after copying the pixels from the source fragment. There are obvious seams in the image. Using gradient correction as proposed by Sun et al. [31] we get the solution in b with strong color bleeding. c shows our simple improvement maintaining high gradients from the source fragment.

Results

Conclusion We have presented a novel system for image completion which allows for perspective corrections of the copied fragments. The correction is based on rectifying homographies, which are interactively defined by the user via simple 2D interaction metaphors. Using these metaphors is easy and intuitive and allows for completing images which previous approaches cannot handle.

Future work We would like to link our image completion system with a large database of images. Another research direction is to extend our method to the completion of video footage by using a 3D Fourier transform and searching for space-time fragments.