RTUEE / EC / EEEYr 2019 · Sem 72019

Q2Digital Image Processing

Question

16 marks

Q.1. (a) Consider the image F=[[1,2],[3,4]]. Apply image rotation by rotation matrix R=[[cos(theta),-sin(theta)],[sin(theta),cos(theta)]], choose theta=45 degrees. [8]

(b) Discuss working of image acquisition system by using CCD sensors. [8]

Answer

Rotating F=[[1,2],[3,4]] by a 45 degree rotation matrix R=[[0.7071,-0.7071],[0.7071,0.7071]] gives R times F = [[-1.4142,-1.4142],[2.8284,4.2426]], illustrating the linear transformation applied to image coordinates during rotation; CCD sensors convert incident light into charge via the photoelectric effect and shift it out through registers to an ADC.

(a) Numerical: Image Rotation by 45 Degrees

We are given the image/coordinate matrix F = [[1,2],[3,4]] and asked to apply the rotation matrix R = [[cos(theta), -sin(theta)], [sin(theta), cos(theta)]] with theta = 45 degrees.

Step 1: Evaluate the rotation matrix at theta = 45 degrees

At theta = 45 degrees, cos(45 deg) = sin(45 deg) = 0.7071 (i.e., 1/sqrt(2)). Substituting these values gives the numerical rotation matrix:

Step 2: Multiply R by F element by element

We compute the matrix product R times F, where F = [[1,2],[3,4]]. Each output element is the dot product of the corresponding row of R with the corresponding column of F.

Row 1, Column 1: 0.7071 x 1 + (-0.7071) x 3 = 0.7071 - 2.1213 = -1.4142

Row 1, Column 2: 0.7071 x 2 + (-0.7071) x 4 = 1.4142 - 2.8284 = -1.4142

Row 2, Column 1: 0.7071 x 1 + 0.7071 x 3 = 0.7071 + 2.1213 = 2.8284

Row 2, Column 2: 0.7071 x 2 + 0.7071 x 4 = 1.4142 + 2.8284 = 4.2426

Step 3: Assemble the resultant matrix

  • cos(45) = sin(45) = 0.7071
  • Element (1,1) = 0.7071(1) - 0.7071(3) = 0.7071 - 2.1213 = -1.4142
  • Element (1,2) = 0.7071(2) - 0.7071(4) = 1.4142 - 2.8284 = -1.4142
  • Element (2,1) = 0.7071(1) + 0.7071(3) = 0.7071 + 2.1213 = 2.8284
  • Element (2,2) = 0.7071(2) + 0.7071(4) = 1.4142 + 2.8284 = 4.2426
  • Result: R x F = [[-1.4142, -1.4142], [2.8284, 4.2426]]

In the general concept of image rotation, every pixel coordinate (x,y) of the original image is transformed by multiplying its coordinate vector by the rotation matrix R to obtain the new, rotated coordinate (x', y') about the origin. A critical practical complication in full image rotation is that the computed rotated coordinates (x', y') are generally non-integer, real-valued positions that do not land exactly on the integer pixel grid of the output image; therefore, interpolation (nearest-neighbor, bilinear, or bicubic) is required to estimate the intensity value at each integer output pixel location from the nearby transformed/rotated source pixel values. The simplified numerical example above, treating F directly as a 2x2 matrix of values being multiplied by R, illustrates the core underlying linear-algebra transformation (multiplying coordinate/value vectors by a rotation matrix) that forms the mathematical basis of the more complete image rotation process applied to a full image.

(b) CCD Sensor Image Acquisition

A CCD (Charge-Coupled Device) sensor consists of a two-dimensional array of photosensitive elements called photosites, each acting as a tiny capacitor. During the exposure interval, incident light photons striking each photosite generate free electrons via the photoelectric effect, and this charge accumulates in proportion to the local intensity and duration of illumination. After exposure, the accumulated charge packets are shifted out using a charge-coupled shift register mechanism: vertical shift registers move each row of charge down toward a horizontal shift register, which then serially shifts the charge packets of that row toward a single output node.

At the output node, an output amplifier converts each charge packet into a proportional analog voltage, and this voltage is subsequently digitized by an analog-to-digital converter (ADC) into a discrete pixel value. This process repeats row by row until the entire array has been read out, assembling the complete digital image. The essential architecture therefore comprises the photosite array (light-to-charge conversion), vertical and horizontal shift registers (charge transport), and the output amplifier plus ADC stage (charge-to-digital-value conversion).

CCD Readout PipelinePhotosite arrayVertical/Horizontalshift registersAmpADC

Returning to the rotation calculation in part (a), it is instructive to note the general property of rotation matrices that they are orthogonal (their inverse equals their transpose) and preserve vector lengths and angles between vectors, meaning that the linear transformation applied to the image data via R never distorts the relative geometric structure of the transformed coordinates; it only reorients them about the origin. This is why rotation is classified as a rigid (distance-preserving) geometric transformation, distinct from other spatial transformations such as scaling or shearing which do alter relative distances or angles within the image. In a real image-rotation implementation, this same rotation matrix would be applied to the (x,y) pixel coordinate of every pixel in the image (not just the small 2x2 numeric example matrix used here), and because the source pixel grid is finite in extent, rotated images are also typically padded, cropped, or resized to accommodate the new bounding rectangle that results once the corners of the original rectangular image are rotated away from their original axis-aligned positions.

Similarly, regarding the CCD sensor, it should be noted that color image acquisition using a single CCD sensor typically requires an additional component: a color filter array (commonly the Bayer pattern) placed directly over the photosite array, in which each individual photosite is covered by a red, green, or blue filter in a specific repeating mosaic pattern (commonly twice as many green filters as red or blue, matching the human eye's greater sensitivity to green wavelengths). Since each photosite therefore only measures light intensity through one of the three color filters, a demosaicing (color interpolation) algorithm is applied after readout to estimate the missing two color channel values at every pixel location from its neighboring, differently-filtered photosites, ultimately producing a complete three-channel (RGB) color image from the single-channel raw sensor readout.

This simplified matrix-multiplication treatment of image rotation, while useful for illustrating the underlying linear transformation, does not capture the full complexity of rotating an actual digital image, since in a real image rotation operation, each output pixel's coordinate is computed by applying the rotation matrix to that pixel's position, and this rotated coordinate will generally NOT correspond exactly to an integer pixel position in the original image grid - this requires an interpolation step (commonly nearest-neighbor, bilinear, or bicubic interpolation) to estimate the appropriate intensity value at each output pixel position from the surrounding original pixel values, since the original image is only defined at its own discrete integer pixel coordinates. Additionally, rotating an image about its center (rather than the origin) requires an additional coordinate-translation step before and after applying the rotation matrix itself, and the rotated image's bounding rectangle generally differs in size from the original image's bounding rectangle (unless the rotation angle is an exact multiple of 90 degrees), requiring the output image canvas to be appropriately resized or the rotated content cropped to fit within the original image dimensions, both practical considerations beyond the simplified 2x2 matrix multiplication illustrated in this problem.

Back to Paper