1 / 110

CPSC 641: Image Registration

CPSC 641: Image Registration. Jinxiang Chai. Review. Image warping Image morphing. Image Warping. Warping function - similarity, affine, projective etc Image warping - forward warping and two-pass 1D warping - backward warping Resampling filter - point sampling

cflippen
Télécharger la présentation

CPSC 641: Image Registration

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CPSC 641: Image Registration Jinxiang Chai

  2. Review Image warping Image morphing

  3. Image Warping Warping function - similarity, affine, projective etc Image warping - forward warping and two-pass 1D warping - backward warping Resampling filter - point sampling - bilinear filter - anisotropic filter x u Inverse y v forward T(u,v) S(x,y)

  4. Image Morphing Point based image morphing Vector based image morphing

  5. h h? Image Registration Image warping: given h and f, compute g g(x) = f(h(x)) g? f Image registration: given h and g, compute f g f

  6. Why Image Registration? Lots of uses • Correct for camera jitter (stabilization) • Align images (mosaics) • View morphing • Image based modeling/rendering • Special effects • Etc.

  7. Image Registration How do we align two images automatically? Two broad approaches: • Feature-based alignment • Find a few matching features in both images • compute alignment • Direct (pixel-based) alignment • Search for alignment where most pixels agree

  8. Outline Image registration - feature-based approach - pixel-based approach

  9. Readings Bergen et al.Hierarchical model-based motion estimation. ECCV’92, pp. 237–252. Shi, J. and Tomasi, C. (1994). Good features to track. In CVPR’94, pp. 593–600. Baker, S. and Matthews, I. (2004). Lucas-kanade 20 years on: A unifying framework. IJCV, 56(3), 221–255.

  10. Outline Image registration - feature-based approach - pixel-based approach

  11. Feature-based Alignment • Find a few important features (aka Interest Points) • Match them across two images • Compute image transformation

  12. Feature-based Alignment • Find a few important features (aka Interest Points) • Match them across two images • Compute image transformation How to choose features • Choose only the points (“features”) that are salient, i.e. likely to be there in the other image

  13. Feature-based Alignment • Find a few important features (aka Interest Points) • Match them across two images • Compute image transformation How to choose features • Choose only the points (“features”) that are salient, i.e. likely to be there in the other image • How to find these features? • windows where has two large eigenvalues • Harris Corner detector

  14. Feature Detection • Two images taken at the same place with different angles • Projective transformationH3X3

  15. Feature Matching ? • Two images taken at the same place with different angles • Projective transformation H3X3

  16. Feature Matching • Intensity/Color similarity • The intensity of pixels around the corresponding features should have similar intensity • SSD, Cross-correlation • Distance constraint • The displacement of features should be smaller than a user-defined threshold

  17. Feature-space Outlier Rejection Can we now compute H3X3 from the blue points? • No! Still too many outliers… • What can we do?

  18. Robust Estimation What if set of matches contains gross outliers?

  19. RANSAC • Objective • Robust fit of model to data set S which contains outliers • Algorithm • Randomly select a sample of s data points from S and instantiate the model from this subset. • Determine the set of data points Si which are within a distance threshold t of the model. The set Si is the consensus set of samples and defines the inliers of S. • If the subset of Si is greater than some threshold T, re-estimate the model using all the points in Si and terminate • If the size of Si is less than T, select a new subset and repeat the above. • After N trials the largest consensus set Si is selected, and the model is re-estimated using all the points in the subset Si

  20. RANSAC Repeat M times: • Sample minimal number of matches to estimate two view relation (affine, perspective, etc). • Calculate number of inliers or posterior likelihood for relation. • Choose relation to maximize number of inliers.

  21. RANSAC Line Fitting Example Task: Estimate best line

  22. RANSAC Line Fitting Example Sample two points

  23. RANSAC Line Fitting Example Fit Line

  24. RANSAC Line Fitting Example Total number of points within a threshold of line.

  25. RANSAC Line Fitting Example Repeat, until get a good result

  26. RANSAC Line Fitting Example Repeat, until get a good result

  27. RANSAC Line Fitting Example Repeat, until get a good result

  28. How Many Samples? Choose N so that, with probability p, at least one random sample is free from outliers. e.g. p=0.99

  29. How Many Samples? Choose N so that, with probability p, at least one random sample is free from outliers. e.g. p=0.99 Affine transform

  30. How Many Samples? Choose N so that, with probability p, at least one random sample is free from outliers. e.g. p=0.99 Projective transform

  31. RANSAC for Estimating Projective Transformation RANSAC loop: • Select four feature pairs (at random) • Compute the transformation matrix H (exact) • Compute inliers where SSD(pi’, H pi) < ε • Keep largest set of inliers • Re-compute least-squares H estimate on all of the inliers

  32. RANSAC

  33. Outline Image registration - feature-based approach - pixel-based approach

  34. Direct (pixel-based) Alignment : Optical flow Will start by estimating motion of each pixel separately Then will consider motion of entire image

  35. Problem Definition: Optical Flow How to estimate pixel motion from image H to image I?

  36. Problem Definition: Optical Flow How to estimate pixel motion from image H to image I? • Solve pixel correspondence problem • given a pixel in H, look for nearby pixels of the same color in I

  37. Problem Definition: Optical Flow How to estimate pixel motion from image H to image I? • Solve pixel correspondence problem • given a pixel in H, look for nearby pixels of the same color in I Key assumptions • color constancy: a point in H looks the same in I • For grayscale images, this is brightness constancy • small motion: points do not move very far This is called the optical flow problem

  38. Optical Flow Constraints Let’s look at these constraints more closely • brightness constancy: Q: what’s the equation?

  39. Optical Flow Constraints Let’s look at these constraints more closely • brightness constancy: Q: what’s the equation? H(x,y) - I(x+u,v+y) = 0

  40. Optical Flow Constraints Let’s look at these constraints more closely • brightness constancy: Q: what’s the equation? H(x,y) - I(x+u,v+y) = 0 • small motion: (u and v are less than 1 pixel) • suppose we take the Taylor series expansion of I:

  41. Optical Flow Constraints Let’s look at these constraints more closely • brightness constancy: Q: what’s the equation? H(x,y) - I(x+u,v+y) = 0 • small motion: (u and v are less than 1 pixel) • suppose we take the Taylor series expansion of I:

  42. Optical Flow Equation Combining these two equations

  43. Optical Flow Equation Combining these two equations

  44. Optical Flow Equation Combining these two equations

  45. Optical Flow Equation Combining these two equations

  46. Optical Flow Equation Combining these two equations In the limit as u and v go to zero, this becomes exact

  47. Optical Flow Equation How many unknowns and equations per pixel?

  48. Optical Flow Equation How many unknowns and equations per pixel? Intuitively, what does this constraint mean?

  49. Optical Flow Equation How many unknowns and equations per pixel? Intuitively, what does this constraint mean? • The component of the flow in the gradient direction is determined • The component of the flow parallel to an edge is unknown

  50. Optical Flow Equation How many unknowns and equations per pixel? Intuitively, what does this constraint mean? • The component of the flow in the gradient direction is determined • The component of the flow parallel to an edge is unknown • This explains the Barber Pole illusion • http://www.sandlotscience.com/Ambiguous/barberpole.htm

More Related