Module 1 Answer Key-1
Module 1 Answer Key-1
Introduction
In computer vision, a camera observes objects that exist in the real world. These objects are
naturally described in a world coordinate system, whereas the camera captures images with
respect to its own camera coordinate system. To establish a mathematical relationship
between these two coordinate systems, it is necessary to use rotation matrices and translation
vectors. Together, these parameters describe the pose of the camera, i.e., its orientation and
position in space.
Rotation Matrix
A rotation matrix represents the orientation of the camera relative to the world coordinate
system. It is used to rotate a point in three-dimensional space without altering its shape, size,
or distance.
These properties ensure that the transformation represents pure rotation without scaling or
distortion.
Example of Rotation
Consider rotation about the Z-axis by an angle 𝜃. The rotation matrix is:
cos 𝜃 −sin 𝜃 0
𝑅𝑧 = [ sin 𝜃 cos 𝜃 0]
0 0 1
This matrix rotates points in the X–Y plane while keeping the Z-coordinate unchanged.
Translation Vector
A translation vector represents the position of the camera with respect to the world coordinate
system. It shifts points along the coordinate axes.
𝑡𝑥
𝑇 = [𝑡𝑦 ]
𝑡𝑧
The complete transformation from world coordinates to camera coordinates is given by:
𝑋𝑐 = 𝑅𝑋𝑤 + 𝑇
This equation indicates that a world point is first rotated and then translated to obtain its
coordinates in the camera frame.
Applications
• 3D scene reconstruction
Conclusion
Rotation matrices and translation vectors form the mathematical foundation for describing
camera motion and orientation in computer vision systems.
Q2. Explain extrinsic camera parameters and derive the transformation from world to
camera coordinates
Introduction
Extrinsic camera parameters describe the geometric relationship between the camera and the
world. These parameters are essential for understanding how a camera views a three-
dimensional scene and are widely used in camera calibration, 3D reconstruction, and
augmented reality applications.
Coordinate Systems
𝑋
𝑋𝑤 = [𝑌 ]
𝑍
To express this point in the camera coordinate system, rotation and translation are applied:
𝑋𝑐 = 𝑅𝑋𝑤 + 𝑇
𝑋𝑐 𝑋𝑤
𝑌 𝑅 𝑇 𝑌𝑤
[ 𝑐] = [ ][ ]
𝑍𝑐 0 1 𝑍𝑤
1 1
Conclusion
Extrinsic camera parameters provide a precise mathematical relationship between the world
and camera coordinate systems.
Q3. With diagrams, explain how sensor geometry and pixel size influence intrinsic
parameters
Introduction
Intrinsic camera parameters describe the internal characteristics of the camera, which depend
on the camera sensor, lens, and pixel geometry. Sensor geometry and pixel size play a crucial
role in determining image resolution and field of view.
• Focal length
• Pixel dimensions
• Principal point
• Skew coefficient
𝑓𝑥 0 𝑐𝑥
𝐾 = [0 𝑓𝑦 𝑐𝑦 ]
0 0 1
where:
𝑓 𝑓
• 𝑓𝑥 = 𝑠 , 𝑓𝑦 = 𝑠
𝑥 𝑦
Principal Point
The principal point is the intersection of the optical axis with the image plane and is usually
located near the image center.
Conclusion
Sensor geometry and pixel size directly influence intrinsic parameters, affecting image
resolution and perspective.
Q4. Discuss the limitations of the pinhole camera model and explain how thin lenses
overcome these limitations
Introduction
The pinhole camera model is a basic imaging model used to explain perspective projection.
Although simple, it has several practical limitations.
The thin lens model replaces the pinhole with a lens, allowing more light to enter the camera.
Advantages of Thin Lens
• Improved brightness
• Adjustable focus
1 1 1
= +
𝑓 𝑢 𝑣
Conclusion
Thin lenses overcome the practical limitations of the pinhole camera model, making them
suitable for real imaging systems.
Q5. With a neat diagram, explain the working of a pinhole camera and derive the
perspective projection equations
Introduction
The pinhole camera is the simplest camera model used to explain image formation and
perspective projection.
𝑥 𝑋 𝑓𝑋
= ⇒𝑥=
𝑓 𝑍 𝑍
𝑦 𝑌 𝑓𝑌
= ⇒𝑦=
𝑓 𝑍 𝑍
Important Observations
Conclusion
The pinhole camera model provides the fundamental mathematical framework for perspective
projection in computer vision.
(3 Marks)
Answer:
Intrinsic camera parameters describe the internal characteristics of a camera that affect how a
3D point is projected onto a 2D image plane. These parameters depend on the camera sensor
and lens and are independent of the camera’s position in the world.
These parameters are usually represented using the intrinsic camera matrix.
(3 Marks)
Answer:
Perspective projection is the process by which 3D points in the real world are mapped onto a
2D image plane using a pinhole camera model. In this projection, light rays from a 3D point
pass through the pinhole and intersect the image plane.
Mathematically, for a 3D point (𝑋, 𝑌, 𝑍), the image coordinates are given by:
𝑓𝑋 𝑓𝑌
𝑥= ,𝑦 =
𝑍 𝑍
Perspective projection causes distant objects to appear smaller, which matches human visual
perception.
Q8. Define the pinhole camera model and list any three of its characteristics
(3 Marks)
Answer:
The pinhole camera model is a simple camera model in which a small aperture allows light
rays from an object to pass through and form an image on the image plane.
(3 Marks)
Answer:
The world coordinate system is a fixed reference frame used to describe the positions of
objects in the real world. It does not change with camera movement.
The camera coordinate system is defined with respect to the camera, where the origin is at the
camera center and the Z-axis points along the optical axis.
To relate these two coordinate systems, rotation and translation transformations are applied.
(3 Marks)
Answer:
A rotation vector represents the orientation of the camera with respect to the world coordinate
system and describes how the camera is rotated in 3D space.
A translation vector represents the position of the camera and describes how the camera is
shifted along the X, Y, and Z axes.
Together, rotation and translation vectors are used to transform points from world coordinates
to camera coordinates.
(14 Marks)
Introduction
In computer vision, camera geometry involves mapping points between different coordinate
systems such as world coordinates, camera coordinates, and image coordinates. These
mappings involve both rotation and translation. Since translation cannot be represented using
simple matrix multiplication in Cartesian coordinates, homogeneous coordinates are
introduced. Homogeneous coordinate transformation provides a unified mathematical
framework to represent rotation, translation, scaling, and perspective projection.
Homogeneous Coordinates
A 3D Cartesian point:
(𝑋, 𝑌, 𝑍)
(𝑋, 𝑌, 𝑍, 1)
A homogeneous transformation matrix combines rotation and translation into a single matrix:
𝑅 𝑇
𝐻=[ ]
0 1
where:
𝑋
𝑌
𝑋𝑤 = [ ]
𝑍
1
𝑋𝑐 = 𝐻𝑋𝑤
or
𝑋𝑐 𝑋
𝑌 𝑅 𝑇 𝑌
[ 𝑐] = [ ][ ]
𝑍𝑐 0 1 𝑍
1 1
• Camera calibration
• 3D reconstruction
• Pose estimation
• Augmented reality
Conclusion
(3 Marks)
Answer:
Extrinsic camera parameters describe the position and orientation of the camera with respect
to the world coordinate system. They define how the camera is placed in the scene.
• Rotation matrix (R), which represents the orientation of the camera, and
These parameters are used to transform 3D points from world coordinates to camera
coordinates.
(14 Marks)
Introduction
Camera calibration is the process of estimating the intrinsic and extrinsic parameters of a
camera. One of the most widely used and practical calibration techniques is calibration using
planar patterns. This method uses a flat object with known geometry, making it easy to
implement and highly accurate.
Planar Calibration Pattern
• Checkerboard pattern
• Easy to manufacture
1. Capture multiple images of the planar pattern at different orientations and positions
3. Establish correspondence between known world points and detected image points
4. Compute a homography between the planar pattern and the image plane
Mathematical Concept
The relationship between a planar object and its image can be represented using a
homography matrix, which maps points from the plane to the image.
Advantages of Planar Calibration
• High accuracy
Applications
Conclusion
Calibration using planar patterns is a reliable and efficient method for estimating camera
parameters and is widely adopted in real-world computer vision applications.
Q14. Explain the steps involved in estimating intrinsic and extrinsic parameters
(14 Marks)
Introduction
Multiple images of a known calibration object are captured from different viewpoints to
obtain sufficient geometric information.
Step 2: Feature Detection
Distinct feature points such as corners or edges are detected in each image using suitable
algorithms.
The detected image points are matched with their corresponding known points in the world
coordinate system.
For planar calibration objects, a homography matrix is computed to relate the plane to the
image.
Using the homography information, intrinsic parameters such as focal length, principal point,
and skew are computed.
Rotation matrix and translation vector are estimated for each image, describing camera pose.
Nonlinear optimization techniques are applied to minimize reprojection error and improve
accuracy.
Applications
• 3D reconstruction
• Autonomous navigation
• Augmented reality
Conclusion
Estimating intrinsic and extrinsic parameters is a multi-step process that forms the backbone
of accurate camera modeling in computer vision.
(3 Marks)
Answer:
Determines the internal parameters of the Determines the position and orientation of the
camera camera
Depends on camera lens and sensor Depends on camera placement in the scene
Q16. Explain the linear approach to camera calibration with mathematical formulation
(14 Marks)
Introduction
Camera calibration is the process of determining the camera parameters that relate a 3D point
in the real world to its corresponding 2D point in an image. One of the earliest and simplest
calibration techniques is the linear approach, commonly known as the Direct Linear
Transformation (DLT) method. This approach assumes a linear relationship between world
points and image points and provides an initial estimate of camera parameters.
𝑥 = 𝐾[𝑅 𝑇]𝑋
where:
• 𝑅= rotation matrix
• 𝑇= translation vector
• 𝑥= image point
Mathematical Formulation
𝑋
𝑌
𝑋=[ ]
𝑍
1
𝑢
𝑥 = [𝑣 ]
1
𝑥 = 𝑃𝑋
Each point correspondence gives a set of linear equations. By using multiple known 3D–2D
point correspondences, a system of linear equations is formed.
Steps in Linear Camera Calibration
• Easy to implement
• Fast computation
• Sensitive to noise
Conclusion
The linear approach to camera calibration provides an initial estimation of camera parameters
and serves as the foundation for more accurate nonlinear calibration methods.
(3 Marks)
Calibration targets are objects with known geometric patterns used in camera calibration.
Their purpose is to provide accurate reference points so that the camera’s intrinsic and
extrinsic parameters can be estimated correctly. They help establish a precise relationship
between known world points and detected image points.
(3 Marks)
Camera calibration is the process of determining the intrinsic parameters (focal length,
principal point, pixel size) and extrinsic parameters (rotation and translation) of a camera. It
establishes the mathematical relationship between the 3D world and the 2D image plane.
(14 Marks )
Introduction
Definition of 2D Convolution
2D convolution is the process of computing the output image by taking a weighted sum of
neighboring pixel values using a small matrix called a kernel or filter.
Mathematical Expression
Let:
Steps in 2D Convolution
Example Filters
Applications of 2D Convolution
• Noise removal
• Image enhancement
• Feature extraction
Conclusion
2D convolution is a fundamental operation in image processing and forms the basis of many
computer vision algorithms.
Q20. Discuss the effects of using different linear filters (average, Gaussian, sharpening)
on images
(14 Marks )
Introduction
In digital image processing and computer vision, images often suffer from problems such as
noise, blur, or lack of clarity. To improve image quality or highlight useful features, linear
filters are applied. A linear filter modifies the value of a pixel by taking a linear combination
of neighboring pixel values.
Different linear filters are designed for different purposes such as smoothing, noise reduction,
and edge enhancement. Among them, average filters, Gaussian filters, and sharpening filters
are the most commonly used.
What is a Linear Filter?
A linear filter produces the output image by applying a convolution operation between the
input image and a filter kernel.
The output pixel value depends on a weighted sum of surrounding pixels.
Definition
The average filter replaces each pixel value with the average of its neighboring pixel values.
It is one of the simplest smoothing filters.
1 1 1 1
[1 1 1]
9
1 1 1
Effects on Images
• Reduces random noise
Advantages
• Simple to implement
Limitations
2. Gaussian Filter
Definition
The Gaussian filter is a smoothing filter that uses a Gaussian (bell-shaped) distribution as its
kernel. Unlike the average filter, it gives more weight to pixels near the center and less
weight to distant pixels.
1 𝑥 2 +𝑦 2
−
𝐺(𝑥, 𝑦) = 𝑒 2𝜎2
2𝜋𝜎 2
Effects on Images
Advantages
• Controlled smoothing
Limitations
3. Sharpening Filter
Definition
Sharpening filters are used to enhance edges and fine details in an image. They work by
emphasizing intensity differences between neighboring pixels.
0 −1 0
[−1 5 −1]
0 −1 0
Working of Sharpening Filter
Effects on Images
Advantages
Limitations
• Amplifies noise
Q21. Explain linear filtering and derive the convolution operation for images
(14 Marks –)
Introduction
In digital image processing, raw images often contain noise, blur, or unwanted details. To
enhance image quality or extract useful information, linear filtering is used. Linear filtering
modifies pixel values based on their neighboring pixels using a mathematical operation called
convolution. It is one of the most fundamental concepts in computer vision.
Linear filtering is a process in which the output pixel value is obtained as a linear
combination of neighboring input pixel values.
1 1 1
[1 1 1]
1 1 1
Each kernel is designed to perform a specific task such as smoothing or sharpening.
Let:
Steps in Convolution
Example
• Image enhancement
• Edge detection
• Feature extraction
Conclusion
Linear filtering using convolution is a core operation in image processing and is widely used
in computer vision applications.
Q22. State the properties of linear filters
(3 Marks)
Answer:
(3 Marks)
Answer:
(3 Marks)
Answer:
Linear filtering is the process of modifying an image by replacing each pixel value with a
linear combination of its neighboring pixel values using a filter kernel. It is widely used for
smoothing, sharpening, and edge detection.
(14 Marks )
Introduction
1D Discrete Convolution
Definition
where:
Explanation
Example
If a signal passes through a smoothing system, convolution determines how each signal value
is modified.
2D Discrete Convolution
Definition
Working of 2D Convolution
• Kernel is flipped
Examples
• Average filter → noise reduction
Applications
• Image smoothing
• Edge detection
• Feature extraction
Q26. Discuss the relationship between impulse response, convolution, and system output
(14 Marks)
Introduction
In signal and image processing, systems are often modeled as Linear Shift Invariant (LSI)
systems. For such systems, the most important concept is the impulse response. Once the
impulse response of a system is known, the output of the system for any input signal can be
computed using convolution. Thus, impulse response, convolution, and system output are
closely related.
Impulse Response
The impulse response of a system is the output obtained when the input to the system is a unit
impulse.
1, 𝑛=0
𝛿[𝑛] = {
0, 𝑛≠0
If the input 𝛿[𝑛]is applied to a system and the output is ℎ[𝑛], then ℎ[𝑛]is called the impulse
response of the system.
Convolution
Convolution is the mathematical operation used to compute the output of an LSI system.
or
∞
where:
Any discrete signal can be represented as a sum of scaled and shifted impulse signals:
𝑥[𝑛] = ∑ 𝑥[𝑘]𝛿[𝑛 − 𝑘]
𝑘
𝑦[𝑛] = ∑ 𝑥[𝑘]ℎ[𝑛 − 𝑘]
𝑘
System Output
Thus, the output of an LSI system is obtained by convolving the input signal with the impulse
response of the system.
Applications
• Signal filtering
Conclusion
In LSI systems, the impulse response uniquely defines the system behavior, and convolution
provides the mathematical link between the input signal and the system output.
Q27. Explain shift invariant systems and derive the discrete convolution operation
(14 Marks)
Introduction
In system theory, many practical systems satisfy two important properties: linearity and shift
invariance. A system that satisfies both properties is called a Linear Shift Invariant (LSI)
system. Shift invariance plays a crucial role in deriving the discrete convolution equation,
which is widely used in signal and image processing.
Shift Invariance
A system is said to be shift invariant if a shift in the input signal causes an identical shift in
the output signal.
If:
𝑥[𝑛] → 𝑦[𝑛]
This means the system behavior does not change with time or position.
Linearity
1. Additivity
2. Homogeneity (scaling)
A system that satisfies both linearity and shift invariance is called an LSI system.
Most filtering operations in image and signal processing are modeled as LSI systems.
𝑥[𝑛] = ∑ 𝑥[𝑘]𝛿[𝑛 − 𝑘]
𝑘
𝑦[𝑛] = ∑ 𝑥[𝑘]ℎ[𝑛 − 𝑘]
𝑘
Significance of Convolution
Conclusion
Shift invariance allows the system output to be expressed as a convolution of the input signal
with the impulse response, forming the foundation of discrete convolution theory.
(3 Marks)
Answer:
The impulse response of an LSI system is the output produced when the input is a unit
impulse signal. It completely characterizes the system behavior. Once the impulse response is
known, the output for any input signal can be obtained using convolution.
(3 Marks )
Answer:
A Linear Shift Invariant (LSI) system is a system that satisfies both linearity and shift
invariance. In such systems, the output corresponding to any input signal can be calculated by
convolving the input with the system’s impulse response.
(3 Marks)
Answer:
Shift invariance is a property of a system in which a shift in the input signal results in the
same shift in the output signal. This means that the system response does not depend on the
absolute position or time of the input signal.
(14 Mark)
Introduction
In computer vision, one common task is to detect a known object or pattern inside a larger
image. Correlation-based pattern detection is a widely used technique for this purpose. It
works by comparing a small template image with different regions of a larger image to find
the best match.
What is Pattern Detection?
Pattern detection is the process of identifying the presence and location of a known pattern
(template) within an image.
Examples:
Correlation Concept
In pattern detection:
Mathematical Expression
The location with the maximum correlation value is considered the detected pattern.
Advantages
Limitations
Applications
• Object detection
• Face recognition
• Industrial inspection
Conclusion
Correlation-based pattern detection is a simple and effective method for locating known
patterns in images by measuring similarity.
Q32. Discuss the steps involved in template matching using correlation measures
(14 Marks)
Introduction
Template matching is a technique used to find a specific pattern or object within an image.
Correlation is one of the most commonly used similarity measures in template matching. This
method compares the template with different parts of the image to identify the best match.
Step 2: Preprocessing
At each position, correlation between the template and the image region is computed using:
𝐶(𝑥, 𝑦) = ∑𝐼(𝑥 + 𝑚, 𝑦 + 𝑛) 𝑇(𝑚, 𝑛)
The correlation values at all positions form a correlation map, which shows similarity across
the image.
The position with the highest correlation value indicates the most likely match.
Advantages
• Simple implementation
Limitations
Applications
• Character recognition
• Object localization
(14 Marks)
Introduction
Mathematical Expression
∑(𝐼 − 𝜇𝐼 )(𝑇 − 𝜇 𝑇 )
𝑁𝐶𝐶 =
𝜎𝐼 𝜎𝑇
where:
• 𝜇𝐼 , 𝜇 𝑇 = mean values
• 𝜎𝐼 , 𝜎𝑇 = standard deviations
Working of NCC
1. Subtract mean from image and template
Advantages of NCC
Applications
• Face detection
• Object recognition
Limitations
• Computationally expensive
Conclusion
(3 Marks)
Answer:
Correlation Convolution
(3 Marks)
Answer:
Template matching is a technique used in computer vision to find the location of a known
pattern (template) within a larger image by comparing the template with different regions of
the image using similarity measures such as correlation.
(3 Marks)
Answer:
Normalized correlation is a similarity measure used in image processing and pattern matching
to compare a template with different regions of an image while reducing the effects of
illumination and contrast variations.
It normalizes the correlation value using the mean and standard deviation of the image and
template, making the comparison more reliable than simple correlation.
Normalized correlation values typically range between –1 and +1, where higher values
indicate better similarity.