Image Transformations
Contents
Image Transformations#
Let us recall from the previous chapter that camera is a mapping from a 3D point \([X_w, Y_w, Z_w]^T\) to a 2D point \([u,v]\) on an image plane. (pixel location).
This chapter of the course deals about the 2D \(\rightarrow\) 2D transformations.
Image filtering and Image warping are some examples of the 2D to 2D transformations. Image filtering does not change the size or shape of the object, it just changes the colors or the texture of objects. Image warping reconfigures the pixel location and hence can change the size/shape of the object in the image.
Image filtering changes the range of the image, whereas image warping changes the domain of the image. Projector is a good example of image warping.
Examples of parametric warps:
Translation
Rotation
Aspect (change the dimensions of the image display)
Affine (parallel lines are still parallel)
Perspective (parallel lines are not parallel)
Cylindrical
3D to 2D we have 11 independent parameters (intrinsic and extrinsic). 2D to 2D mapping has 4 parameters.
Scaling#
Scaling happens after we shoot the image.
It is defined by multiplying each component in the image by a scalar. Uniform scaling means this scalar is the same for all components.
Fig. 6 2D scaling#
One important thing to note here is that scaling not only increases the size of the object (house in this case), but also changes the distance between the pixel and the origin. Depending on the values of the scaling factors along \(x\) and \(y\), the image may either shrink in size of expand.
Scaling operation:
2D Rotation#
Rotate a point \((x,y)\) counter clockwise, by an angle \(\theta\).
Fig. 7 2D rotation#
Even though \(sin(\theta)\) and \(cos(\theta)\) are non-linear functions of \(\theta\), \(x'\) and \(y'\) are linear combinations of \(x\) and \(y\) . For more information about 3D rotation, refer here
2D Translation#
Using \(2 \times 2\) matrix, we cannot perform translation.
To perform translation using matrix multiplication, we perform homegeneousation. Translation matrix will become:
\(2 \times 2\) matrix \(M\) cannot perform translation. Hence, we increase the dimensions to \(3 \times 3\).
Fig. 8 2D Transformations#
Affine transformation#
Affine transformation is the combination of linear transformations and translations.
Properties:
Origin does not necessarily map to origin.
Lines are still lines.
Parallel lines remain parallel.
Ratios are preserved.
Closed under composition.
Projective transformation#
Projective transformation is the combination of affine transformation and projective warps.
Properties:
Origin does not necessarily map to origin.
Lines map to lines.
Parallel lines do not necessarily remain parallel.
Ratios are not preserved.
Closed under composition.
Camera performs perspective projection, which is more complex than affine translation.
Summary of 3D - 3D transformation can be found in the image below.
Fig. 9 Summary of 3D-3D transformation#