Image Warping and Alignment
AJIT RAJWADE
Basics
2
Basics
3
Basics
4
Image Alignment
5
Pixels in digital correspondence (same coordinate values in the image domain Ω, not necessarily containing measurements of the same physical point)
Pixels in physical correspondence (containing measurements of the same physical point, but not necessarily the same coordinate values in the image domain Ω)
Image Alignment
6
Motion Models
7
2D Rotation matrix (orthonormal matrix)
Motion Models
8
-Perform translation such that (xc,yc) coincides with the origin (0,0).
-Rotate about the new origin.
-Translate back.
-The extra ones (third row) are called homogeneous coordinates – they facilitate using matrix multiplication to represent translations.
Motion Models
9
Assumption: the 2 x 2 sub-matrix A is NOT rank deficient, otherwise it will transform two-dimensional figures into a line or a point
Motion Models
10
Motion Models
11
Motion Models
12
Motion Models
13
Motion Models
14
Alignment with control points
15
Control points: pairs of physically corresponding points – maybe marked out manually, or automatically using geometric properties of the image.
Number of control points k MUST be
>= u/2, where u = number of unknown parameters in the motion model (each point has two coordinates – x and y). The number of control points is several times smaller than the number of image pixels.
Solve for unknown parameters using least-squares framework (i.e. pseudo-inverse)
Apply the motion based on these parameters to the first image
Alignment with control points
16
Alignment with mean squared error
17
Find transformation matrix T which produces the least value of MSSD
Alignment with mean squared error
18
Alignment with mean-squared error
19
Image Warping
20
Image Warping
-Can leave the destination image with some holes if you scale up.
-Can lead to multiple answers in one pixel if you scale down.
21
Image warping
22
Interpolation
23
a1
a2
a3
a4
A
B
C
D
Nearest neighbor method:
Bilinear method:
Bilinear interpolation in more detail
24
We interpolate first in the X direction:
We then interpolate first in the Y direction:
In both cases, notice that higher weight is given to the pixels that are closer to P.
Bilinear interpolation in more detail
25
This formula will remain unchanged if you first interpolated in the Y direction and then in the X direction. Verify this yourself.
Bilinear interpolation in more detail
26
Bilinear interpolation in more detail
27
Alignment with mean squared error
28
Careful: field of view issues!
29
Region of overlap (also called field of view) when the moving image is warped
Fixed image (also called reference image)
Note: compute MSSD only over region of overlap.
30
-60
-45
-30
-15
0
+15
+30
+45
+60
Change in region of overlap (also called field of view), as the moving image is warped. The field of view in any of these figures consists of all those pixels not marked black. It represents the set of pixels (x,y) where both I1(x,y) and I2(x,y) are well defined.
Alignment with mean squared error
31
Image alignment: Intensity changes in images
32
MR-T1
MR-PD
Image alignment: Intensity changes in images
33
Physically corresponding points
Image alignment: Intensity changes in images
34
Physically corresponding points
Normalized cross-correlation, also called correlation-coefficient
We are taking the absolute value here, to take care of cases where one image has positive values and the other has negative values. We are assuming a linear relationship between the intensities of I1 and I2 but we do not assume knowledge of the scalar coefficients a and b.
Image alignment: Intensity changes in images
35
Normalized cross-correlation, also called correlation-coefficient.
The NCC is like the absolute normalized dot product between mean-deducted images.
Image alignment: intensity changes in images?
36
Image Histogram
37
38
These are unnormalized histograms of two different images. That is, the entries of the histogram represent frequencies in this case without division by HW = #pixels.
Joint Image Histogram
39
40
Registered images: joint histogram plot looks “streamlined”
Values in I1 (from 0 to 60)
Values in I2
from 0 to 60
I1
I2
41
Misaligned images: joint histogram plot looks “dispersed”
We need a method to quantify how dispersed a joint histogram actually is.
Values in I1 (from 0 to 60)
Values in I2
from 0 to 60
Measure of dispersion
42
Entropy
43
Joint entropy
-Uniform distribution on X and Y: entropy value log(|DX||DY|) where DX, DY are the set of discrete values that X and Y can acquire
-Kronecker delta (i.e. a PMF will all probability concentrated on only one entry with others being 0): entropy value 0 = non uncertainty
44
Joint entropy
45
46
I1
I2: obtained by squaring the intensities of I1, and rotating I1 anticlockwise by 30 degrees.
I2 treated as moving image, I1 treated as fixed image. Joint entropy minimum occurs at -30 degrees.
Components of an Image Alignment Algorithm
47
Image Alignment: applications, related problems
48
Template Matching
49
Templates
Template matching
50
Image Panoramas
51
http://cs.bath.ac.uk/brown/autostitch/autostitch.html
A camera has a limited field of view. A scene may have much larger “area” than what can be captured from a single camera.
So one can acquire multiple images, each from a different viewpoint, and you need to stitch these together to form a panorama or mosaic. The stitching involves more complicated motion models (called homography) than what you have studied in this course.
What we learnt..
52
What we didn’t learn
53