图像拼接
Image Stitching
x′y′1=ad0be0cf1xy1=ax+by+cdx+ey+f1
Solution1:
[x′y′]=[x0y0100x0y01]=abcdef
x10x20⋮xn0y10y20⋮yn01010⋮100x10x2⋮0xn0y10y2⋮0yn0101⋮01abcdef=x1′y1′x2′y2′⋮xn′yn′
⇒2n×6A6×1t=2n×1b
- Least squares: find t that minimizes ∣∣At−b∣∣2
- The solution is given by
ATAt=Atbt=(ATA)−1Atb
Solution2:
x10x20xn0y10y20yn01010100x10x20xn0y10y2⋮0yn010101−x1′−y1′−x1′−y1′−xn′−yn′abcdef1=00⋮00
x′y′1≅h00h10h20h01h11h21h02h12h22xy1
xi′=h20xi+h21yi+h22h00xi+h01yi+h02
yi′=h20xi+h21yi+h22h10xi+h11yi+h12
xi′(h20xi+h21yi+h22)=h00xi+h01yi+h02
yi′(h20xi+h21yi+h22)=h10xi+h11yi+h12
x10xn0y10yn010100x10xn0y1⋮0yn0101−x1′x1−y1′x1−xn′xn−yn′xn−x1′y1−y1′y1−xn′yn−yn′yn−x1′−y1′−xn′−yn′h00h01h02h10h11h12h20h21h22=00⋮00
⇒2n×9A9×1h=2n×10
- Least squares: find h that minimizes ∣∣Ah−0∣∣2
- Since h is defined up to scale, solve for unit vector h^
- Solution: h^ = eigenvector of ATA with smallest eigenvalue
RANSAC
- Randomly choose s samples. Typically s = minimum sample size that lets you fit a model
- Fit a model (e.g., transformation matrix) to those samples
- Count the number of inliers that approximately fit the model
- Repeat N times
- Choose the model that has the largest set of inliers