0% found this document useful (0 votes)
7 views46 pages

Module 1 Answer Key-1

The document discusses various aspects of camera geometry in computer vision, focusing on rotation matrices, translation vectors, and intrinsic and extrinsic camera parameters. It explains how these elements are used to relate world coordinates to camera coordinates, the limitations of the pinhole camera model, and the advantages of using thin lenses. Additionally, it covers calibration techniques using planar patterns and the steps involved in estimating camera parameters.

Uploaded by

nivithavijesh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views46 pages

Module 1 Answer Key-1

The document discusses various aspects of camera geometry in computer vision, focusing on rotation matrices, translation vectors, and intrinsic and extrinsic camera parameters. It explains how these elements are used to relate world coordinates to camera coordinates, the limitations of the pinhole camera model, and the advantages of using thin lenses. Additionally, it covers calibration techniques using planar patterns and the steps involved in estimating camera parameters.

Uploaded by

nivithavijesh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Q1.

Discuss rotation matrices and translation vectors with suitable examples

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.

A rotation matrix 𝑅is a 3 × 3 orthonormal matrix given by:

𝑟11 𝑟12 𝑟13


𝑟
𝑅 = [ 21 𝑟22 𝑟23 ]
𝑟31 𝑟32 𝑟33

Properties of Rotation Matrix

• 𝑅 𝑇 𝑅 = 𝐼, where 𝐼is the identity matrix

• Determinant of 𝑅is equal to 1

• The rows and columns of 𝑅are mutually perpendicular unit vectors

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.

𝑡𝑥
𝑇 = [𝑡𝑦 ]
𝑡𝑧

where 𝑡𝑥 , 𝑡𝑦 , and 𝑡𝑧 represent translations along the X, Y, and Z axes respectively.

Combined Rotation and Translation

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

• Camera pose estimation

• Robot navigation and localization

• 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.

Extrinsic Camera Parameters

Extrinsic parameters consist of two components:

1. Rotation matrix (R) – describes the orientation of the camera

2. Translation vector (T) – describes the position of the camera

Together, these parameters define the pose of the camera.

Coordinate Systems

World Coordinate System

• Fixed reference frame

• Used to describe object positions in the real world

Camera Coordinate System

• Origin at the camera center

• Z-axis aligned with the optical axis

Derivation of World-to-Camera Transformation


Let a 3D point in the world coordinate system be:

𝑋
𝑋𝑤 = [𝑌 ]
𝑍

To express this point in the camera coordinate system, rotation and translation are applied:

𝑋𝑐 = 𝑅𝑋𝑤 + 𝑇

Homogeneous Coordinate Representation

To simplify transformations, homogeneous coordinates are used:

𝑋𝑐 𝑋𝑤
𝑌 𝑅 𝑇 𝑌𝑤
[ 𝑐] = [ ][ ]
𝑍𝑐 0 1 𝑍𝑤
1 1

Importance of Extrinsic Parameters

• Enable mapping of 3D world points to camera frame

• Essential for camera calibration

• Used in robotics and augmented reality

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.

Intrinsic Camera Parameters

The intrinsic parameters include:

• Focal length

• Pixel dimensions

• Principal point

• Skew coefficient

Intrinsic Camera Matrix

𝑓𝑥 0 𝑐𝑥
𝐾 = [0 𝑓𝑦 𝑐𝑦 ]
0 0 1

where:

𝑓 𝑓
• 𝑓𝑥 = 𝑠 , 𝑓𝑦 = 𝑠
𝑥 𝑦

• (𝑐𝑥 , 𝑐𝑦 )is the principal point

Effect of Sensor Geometry

• Larger sensors provide a wider field of view

• Smaller sensors produce a cropped or zoomed effect

Effect of Pixel Size

• Smaller pixels increase spatial resolution


• Larger pixels reduce image detail

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.

Limitations of the Pinhole Camera Model

1. Very low image brightness

2. Diffraction effects causing blur

3. Long exposure time

4. No control over focus

Thin Lens Camera Model

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

• Reduced diffraction effects

• Realistic depth of field

Thin Lens Equation

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.

Working of a Pinhole Camera

• Light travels in straight lines

• Rays pass through a single pinhole

• An inverted image is formed on the image plane


Perspective Projection Geometry

Consider a 3D point (𝑋, 𝑌, 𝑍)projected onto the image plane at (𝑥 , 𝑦).

Derivation of Projection Equations

Using similar triangles:

𝑥 𝑋 𝑓𝑋
= ⇒𝑥=
𝑓 𝑍 𝑍
𝑦 𝑌 𝑓𝑌
= ⇒𝑦=
𝑓 𝑍 𝑍

Important Observations

• Objects farther from the camera appear smaller

• Parallel lines converge at a vanishing point

• Matches human visual perception

Conclusion

The pinhole camera model provides the fundamental mathematical framework for perspective
projection in computer vision.

Q6. Define intrinsic camera parameters with examples

(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.

Examples of intrinsic parameters are:

• Focal length of the camera


• Principal point (optical center)

• Pixel size in horizontal and vertical directions

• Skew coefficient between image axes

These parameters are usually represented using the intrinsic camera matrix.

Q7. Explain the concept of perspective projection in a pinhole camera

(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.

Characteristics of the pinhole camera model (any three):

1. Forms an inverted image

2. Has no lens distortion


3. Provides infinite depth of field

4. Uses perspective projection

Q9. Explain world coordinate system vs camera coordinate system

(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.

Q10. What are rotation and translation vectors?

(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.

Q11. Explain homogeneous coordinate transformation used in camera geometry

(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

In homogeneous coordinates, an n-dimensional point is represented using 𝑛 + 1coordinates.

A 3D Cartesian point:

(𝑋, 𝑌, 𝑍)

is represented in homogeneous form as:

(𝑋, 𝑌, 𝑍, 1)

The additional coordinate allows translation to be included as part of a matrix operation.

Need for Homogeneous Coordinates

• Enables representation of translation using matrix multiplication

• Simplifies concatenation of multiple transformations

• Widely used in camera modeling and 3D graphics

Homogeneous Transformation Matrix

A homogeneous transformation matrix combines rotation and translation into a single matrix:

𝑅 𝑇
𝐻=[ ]
0 1

where:

• 𝑅is a 3 × 3 rotation matrix


• 𝑇is a 3 × 1 translation vector

World to Camera Transformation

Let a point in world coordinates be:

𝑋
𝑌
𝑋𝑤 = [ ]
𝑍
1

The corresponding camera coordinates are obtained by:

𝑋𝑐 = 𝐻𝑋𝑤

or

𝑋𝑐 𝑋
𝑌 𝑅 𝑇 𝑌
[ 𝑐] = [ ][ ]
𝑍𝑐 0 1 𝑍
1 1

Advantages of Homogeneous Transformation

• Combines rotation and translation in one step

• Simplifies mathematical computation

• Allows chaining of multiple transformations

Applications in Camera Geometry

• Camera calibration

• 3D reconstruction

• Pose estimation
• Augmented reality

Conclusion

Homogeneous coordinate transformation is a fundamental concept in camera geometry that


provides an efficient and elegant way to represent spatial transformations in computer vision
systems.

Q12. Define extrinsic camera parameters

(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.

Extrinsic parameters consist of:

• Rotation matrix (R), which represents the orientation of the camera, and

• Translation vector (T), which represents the position of the camera.

These parameters are used to transform 3D points from world coordinates to camera
coordinates.

Q13. With diagrams, describe calibration using planar patterns

(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

A planar calibration pattern is a flat surface containing a known arrangement of feature


points, such as:

• Checkerboard pattern

• Square grid pattern

The distances between feature points are known precisely.

Why Planar Patterns Are Used

• Easy to manufacture

• No need for complex 3D objects

• Can be viewed from different orientations

Calibration Procedure Using Planar Patterns

1. Capture multiple images of the planar pattern at different orientations and positions

2. Detect feature points such as corners of checkerboard squares

3. Establish correspondence between known world points and detected image points

4. Compute a homography between the planar pattern and the image plane

5. Use homography to estimate intrinsic camera parameters

6. Compute extrinsic parameters (rotation and translation) for each image

7. Refine parameters using optimization techniques to reduce error

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

• Low computational complexity

• Suitable for practical camera systems

Applications

• Mobile phone camera calibration

• Industrial vision systems

• Robotics and automation

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

Accurate estimation of intrinsic and extrinsic camera parameters is essential for


understanding the relationship between the 3D world and its 2D image. These parameters
play a crucial role in camera calibration and computer vision applications.

Step 1: Image Acquisition

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.

Step 3: Feature Correspondence

The detected image points are matched with their corresponding known points in the world
coordinate system.

Step 4: Homography Estimation

For planar calibration objects, a homography matrix is computed to relate the plane to the
image.

Step 5: Estimation of Intrinsic Parameters

Using the homography information, intrinsic parameters such as focal length, principal point,
and skew are computed.

Step 6: Estimation of Extrinsic Parameters

Rotation matrix and translation vector are estimated for each image, describing camera pose.

Step 7: Parameter Refinement

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.

Q15. Differentiate between intrinsic and extrinsic calibration

(3 Marks)

Answer:

Intrinsic Calibration Extrinsic Calibration

Determines the internal parameters of the Determines the position and orientation of the
camera camera

Includes focal length, principal point, and


Includes rotation and translation parameters
pixel size

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.

Camera Projection Model


A 3D point in the world is projected onto the 2D image plane through the camera using the
projection equation:

𝑥 = 𝐾[𝑅 𝑇]𝑋

where:

• 𝑋= 3D world point (homogeneous coordinates)

• 𝑅= rotation matrix

• 𝑇= translation vector

• 𝐾= intrinsic camera matrix

• 𝑥= image point

The matrix 𝑃 = 𝐾[𝑅 𝑇]is called the camera projection matrix.

Mathematical Formulation

Let a 3D point be represented in homogeneous coordinates as:

𝑋
𝑌
𝑋=[ ]
𝑍
1

and the corresponding image point be:

𝑢
𝑥 = [𝑣 ]
1

The projection relationship is written as:

𝑥 = 𝑃𝑋

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

1. Select a calibration object with known 3D coordinates

2. Capture image points corresponding to the known world points

3. Form linear equations using the projection model

4. Solve the equations using least squares method

5. Obtain the camera projection matrix

6. Extract intrinsic and extrinsic parameters

Advantages of Linear Approach

• Simple mathematical formulation

• Easy to implement

• Fast computation

Limitations of Linear Approach

• Sensitive to noise

• Less accurate than nonlinear methods

• Requires good quality point correspondences

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.

Q17. What is the purpose of calibration targets?

(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.

Q18. Define camera calibration

(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.

Q19. Explain 2D convolution with suitable examples and diagrams

(14 Marks )

Introduction

In digital image processing, images are treated as two-dimensional signals. To modify or


analyze images, a mathematical operation called 2D convolution is used. It is the foundation
of many image processing tasks such as smoothing, sharpening, and edge detection.

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:

• 𝑓(𝑥, 𝑦)= input image

• ℎ(𝑚, 𝑛)= filter kernel

• 𝑔(𝑥, 𝑦)= output image


The convolution operation is defined as:

𝑔(𝑥, 𝑦) = ∑ ∑ 𝑓(𝑥 − 𝑚, 𝑦 − 𝑛) ℎ(𝑚, 𝑛)


𝑛
𝑚

Steps in 2D Convolution

1. The filter kernel is flipped horizontally and vertically

2. The kernel is placed over the image

3. Each kernel value is multiplied with the corresponding image pixel

4. All products are summed to get the output pixel

5. The kernel is moved across the image

Example Filters

• Averaging filter – smooths the image

• Sharpening filter – enhances edges

• Edge detection filter – highlights boundaries

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.

Linear filters are widely used because:

• They are mathematically simple

• They are easy to implement

• They form the basis of many advanced image processing techniques

1. Average Filter (Mean Filter)

Definition

The average filter replaces each pixel value with the average of its neighboring pixel values.
It is one of the simplest smoothing filters.

A typical 3×3 average filter kernel is:

1 1 1 1
[1 1 1]
9
1 1 1

Working of Average Filter

• The kernel is placed over the image

• Each pixel under the kernel is summed

• The sum is divided by the number of pixels

• The result replaces the center pixel

Effects on Images
• Reduces random noise

• Smooths the image

• Blurs edges and fine details

Advantages

• Simple to implement

• Effective for reducing uniform noise

Limitations

• Causes excessive blurring

• Important edges and details may be lost

• Not suitable where edge preservation is important

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.

A Gaussian kernel is defined as:

1 𝑥 2 +𝑦 2

𝐺(𝑥, 𝑦) = 𝑒 2𝜎2
2𝜋𝜎 2

where 𝜎controls the amount of smoothing.

Working of Gaussian Filter

• Central pixels contribute more to the output


• Neighboring pixels contribute less based on distance

• Produces smooth and natural-looking results

Effects on Images

• Smooths the image effectively

• Reduces Gaussian noise

• Preserves edges better than average filter

Advantages

• Controlled smoothing

• Less blurring of edges

• Widely used in real-world applications

Limitations

• Still causes some loss of fine details

• Computationally more expensive than average filter

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.

A common sharpening kernel is:

0 −1 0
[−1 5 −1]
0 −1 0
Working of Sharpening Filter

• Highlights regions with rapid intensity changes

• Strengthens edges and boundaries

• Increases local contrast

Effects on Images

• Makes edges more visible

• Enhances fine details

• Improves image clarity

Advantages

• Useful for feature extraction

• Improves visual appearance

• Enhances object boundaries

Limitations

• Amplifies noise

• Over-sharpening may create artifacts

Comparison of Linear Filters

Filter Type Main Purpose Effect on Image

Average Filter Smoothing Strong blur, noise reduction


Filter Type Main Purpose Effect on Image

Gaussian Filter Controlled smoothing Smooth image, edge preservation

Sharpening Filter Detail enhancement Sharp edges, increased contrast

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.

What is Linear Filtering?

Linear filtering is a process in which the output pixel value is obtained as a linear
combination of neighboring input pixel values.

Mathematically, the output depends on:

• Input image values

• Filter coefficients (kernel)

Filter Kernel (Mask)

A filter kernel is a small matrix that slides over the image.

Example (3×3 kernel):

1 1 1
[1 1 1]
1 1 1
Each kernel is designed to perform a specific task such as smoothing or sharpening.

Convolution Operation – Mathematical Derivation

Let:

• 𝑓(𝑥, 𝑦)= input image

• ℎ(𝑚, 𝑛)= filter kernel

• 𝑔(𝑥, 𝑦)= output image

The convolution operation is defined as:

𝑔(𝑥, 𝑦) = ∑ ∑ 𝑓(𝑥 − 𝑚, 𝑦 − 𝑛) ℎ(𝑚, 𝑛)


𝑛
𝑚

Steps in Convolution

1. Flip the kernel horizontally and vertically

2. Place it over the image pixel

3. Multiply kernel values with corresponding image pixels

4. Add all values

5. Assign the result to the output pixel

6. Move the kernel across the image

Example

• Averaging filter → smooths image

• Edge detection filter → highlights boundaries

Applications of Linear Filtering


• Noise reduction

• 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:

The important properties of linear filters are:

1. Linearity – Output follows the principle of superposition

2. Shift invariance – Shifting the input shifts the output equally

3. Additivity – Response to sum of inputs equals sum of responses

Q23. What is convolution? Provide its mathematical expression

(3 Marks)

Answer:

Convolution is a mathematical operation used to determine the output of a system by


combining an input signal with a filter or system response.

For a 2D image, convolution is defined as:

𝑔(𝑥, 𝑦) = ∑ ∑ 𝑓(𝑥 − 𝑚, 𝑦 − 𝑛) ℎ(𝑚, 𝑛)


𝑛
𝑚
where 𝑓(𝑥, 𝑦)is the input image and ℎ(𝑚, 𝑛)is the filter kernel.

Q24. Define linear filtering in image processing

(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.

Q25. Explain discrete convolution for 1D and 2D signals with examples

(14 Marks )

Introduction

Convolution is a fundamental operation used to analyze how a signal or image is affected by


a system. In computer vision, convolution is applied to both 1D signals (such as audio or
sensor data) and 2D signals (images).

1D Discrete Convolution

Definition

1D discrete convolution is used for time-based signals and is defined as:


𝑦[𝑛] = ∑ 𝑥[𝑘] ℎ[𝑛 − 𝑘]


𝑘=−∞

where:

• 𝑥[𝑘]= input signal

• ℎ[𝑛]= impulse response


• 𝑦[𝑛]= output signal

Explanation

Each output value is obtained by:

• Shifting the impulse response

• Multiplying with input values

• Summing the results

Example

If a signal passes through a smoothing system, convolution determines how each signal value
is modified.

2D Discrete Convolution

Definition

2D convolution is used for images, which are 2D signals.

𝑔(𝑥, 𝑦) = ∑ ∑ 𝑓(𝑥 − 𝑚, 𝑦 − 𝑛) ℎ(𝑚, 𝑛)


𝑛
𝑚

Working of 2D Convolution

• Kernel is flipped

• Moved across image

• Produces a filtered image

Examples
• Average filter → noise reduction

• Sharpening filter → edge enhancement

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.

For a discrete-time system, the unit impulse signal is defined as:

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.

Importance of Impulse Response


• Completely characterizes an LSI system

• Determines how the system reacts to different inputs

• Used to analyze and design filters

Convolution

Convolution is the mathematical operation used to compute the output of an LSI system.

For a discrete-time system, convolution is defined as:

𝑦[𝑛] = 𝑥[𝑛] ∗ ℎ[𝑛]

or

𝑦[𝑛] = ∑ 𝑥[𝑘] ℎ[𝑛 − 𝑘]


𝑘=−∞

where:

• 𝑥[𝑛]= input signal

• ℎ[𝑛]= impulse response

• 𝑦[𝑛]= output signal

Relationship Between Impulse Response and Convolution

Any discrete signal can be represented as a sum of scaled and shifted impulse signals:

𝑥[𝑛] = ∑ 𝑥[𝑘]𝛿[𝑛 − 𝑘]
𝑘

For an LSI system:

• Response to 𝛿[𝑛]→ ℎ[𝑛]

• Response to 𝛿[𝑛 − 𝑘]→ ℎ[𝑛 − 𝑘]


• Response to 𝑥[𝑘]𝛿[𝑛 − 𝑘]→ 𝑥[𝑘]ℎ[𝑛 − 𝑘]

Adding responses for all values of 𝑘:

𝑦[𝑛] = ∑ 𝑥[𝑘]ℎ[𝑛 − 𝑘]
𝑘

This equation is the convolution sum.

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

• Image smoothing and sharpening

• Audio and speech processing

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:

𝑥[𝑛] → 𝑦[𝑛]

then for a shift 𝑛0 :


𝑥[𝑛 − 𝑛0 ] → 𝑦[𝑛 − 𝑛0 ]

This means the system behavior does not change with time or position.

Linearity

A system is linear if it satisfies:

1. Additivity

2. Homogeneity (scaling)

Linear Shift Invariant (LSI) System

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.

Representation of Input Signal

Any discrete signal can be expressed as a sum of shifted impulses:

𝑥[𝑛] = ∑ 𝑥[𝑘]𝛿[𝑛 − 𝑘]
𝑘

Response of an LSI System

• Response to 𝛿[𝑛]→ ℎ[𝑛]

• Response to 𝛿[𝑛 − 𝑘]→ ℎ[𝑛 − 𝑘]

• Response to 𝑥[𝑘]𝛿[𝑛 − 𝑘]→ 𝑥[𝑘]ℎ[𝑛 − 𝑘]

Derivation of Discrete Convolution


By adding the responses to all shifted impulses:

𝑦[𝑛] = ∑ 𝑥[𝑘]ℎ[𝑛 − 𝑘]
𝑘

This equation is known as the discrete convolution sum.

Significance of Convolution

• Simplifies system analysis

• Used to compute output of LSI systems

• Widely applied in image and signal processing

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.

Q28. Write a note on impulse response of LSI systems

(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.

Q29. What is a linear shift invariant (LSI) system?

(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.

Q30. Define shift invariance

(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.

31. With diagrams, illustrate how correlation-based pattern detection works

(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:

• Detecting a face in an image

• Finding a logo in a scene

• Locating characters in document images

Correlation Concept

Correlation measures the similarity between two signals or images.


If two image regions are similar, the correlation value will be high.

In pattern detection:

• Template → known pattern

• Image → search space

Working Principle of Correlation-Based Detection

1. A small template image is selected

2. The template is moved (slid) over the input image

3. At each position, correlation is computed

4. A correlation map is generated

5. Peaks in the correlation map indicate possible matches

Mathematical Expression

For an image 𝐼(𝑥, 𝑦)and a template 𝑇(𝑚, 𝑛):


𝐶(𝑥, 𝑦) = ∑ ∑ 𝐼(𝑥 + 𝑚, 𝑦 + 𝑛) 𝑇(𝑚, 𝑛)
𝑛
𝑚

Higher values of 𝐶(𝑥, 𝑦)indicate stronger similarity.

Interpretation of Correlation Output

• High correlation → good match

• Low correlation → poor match

The location with the maximum correlation value is considered the detected pattern.

Advantages

• Simple to understand and implement

• Effective for exact pattern matching

Limitations

• Sensitive to illumination changes

• Sensitive to scale and rotation changes

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 1: Template Selection

A template is a small image representing the object or pattern to be detected.


It must clearly represent the desired object.

Step 2: Preprocessing

• Convert images to grayscale

• Normalize intensity values

• Reduce noise if necessary

This improves matching accuracy.

Step 3: Sliding the Template

The template is moved pixel by pixel over the entire image.


At each position, similarity is calculated.

Step 4: Correlation Computation

At each position, correlation between the template and the image region is computed using:
𝐶(𝑥, 𝑦) = ∑𝐼(𝑥 + 𝑚, 𝑦 + 𝑛) 𝑇(𝑚, 𝑛)

Step 5: Generation of Correlation Map

The correlation values at all positions form a correlation map, which shows similarity across
the image.

Step 6: Detection of Maximum Value

The position with the highest correlation value indicates the most likely match.

Step 7: Decision Making

A threshold is applied to decide whether the detected match is valid.

Advantages

• Simple implementation

• Effective for exact matches

Limitations

• Sensitive to lighting changes

• Not robust to rotation or scale changes

Applications

• Character recognition

• Object localization

• Medical image analysis


Conclusion

Template matching using correlation is a straightforward method for detecting known


patterns, though it works best under controlled conditions.

Q33. Explain normalized cross-correlation and its application in pattern matching

(14 Marks)

Introduction

Simple correlation is sensitive to changes in illumination and contrast. To overcome this


problem, Normalized Cross-Correlation (NCC) is used. NCC improves robustness by
normalizing intensity values before comparison.

What is Normalized Cross-Correlation?

Normalized cross-correlation measures similarity while eliminating the effects of brightness


and contrast variations.

Mathematical Expression

For image 𝐼and template 𝑇:

∑(𝐼 − 𝜇𝐼 )(𝑇 − 𝜇 𝑇 )
𝑁𝐶𝐶 =
𝜎𝐼 𝜎𝑇

where:

• 𝜇𝐼 , 𝜇 𝑇 = mean values

• 𝜎𝐼 , 𝜎𝑇 = standard deviations

Working of NCC
1. Subtract mean from image and template

2. Normalize using standard deviation

3. Compute similarity score

NCC values range from –1 to +1.

Advantages of NCC

• Robust to illumination changes

• More reliable than simple correlation

• Widely used in real applications

Applications

• Face detection

• Medical image matching

• Object recognition

Limitations

• Computationally expensive

• Sensitive to rotation and scale

Conclusion

Normalized cross-correlation improves pattern matching accuracy by handling brightness


variations effectively.

Q34. State the difference between correlation and convolution

(3 Marks)
Answer:

Correlation Convolution

Template is not flipped Kernel is flipped

Used for similarity measurement Used for filtering

Common in pattern matching Common in image processing

Q35. What is template matching?

(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.

Q36. Define normalized 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.

You might also like