0% found this document useful (0 votes)
5 views5 pages

Tutorial and Assignment (Answers)

The document provides an overview of various image processing techniques, including Canny edge detection, histogram equalization, and image filtering methods. It details the steps involved in edge detection, the differences between local and global features, and applications of face recognition technology. Additionally, it discusses the importance of convolution and correlation in image processing, as well as practical applications of face detection in security and social media.
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)
5 views5 pages

Tutorial and Assignment (Answers)

The document provides an overview of various image processing techniques, including Canny edge detection, histogram equalization, and image filtering methods. It details the steps involved in edge detection, the differences between local and global features, and applications of face recognition technology. Additionally, it discusses the importance of convolution and correlation in image processing, as well as practical applications of face detection in security and social media.
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

Tutorial and Assignment (Answers)

1. How does canny edge detection works?


Canny edge detection is a technique to extract useful structural information from different vision
objects. Dramatically reduce the amount of data to be processed. It has been widely applied in
various computer vision systems. Canny also produced a computational theory of edge detection
explaining why the technique works. The Canny edge detection algorithm is composed of 5 steps:
1. Noise Reduction: Since edge detection is highly sensitive to image noise, the algorithm first
applies a Gaussian blur (often using a 5x5 kernel) to smooth the image and remove minor
intensity variations.
2. Gradient Calculation: The algorithm computes the intensity gradients in both horizontal (Gx)
and vertical (Gy) directions using Sobel operators. This determines the edge strength
(magnitude) and orientation (angle) for every pixel.
3. Non-Maximum Suppression: To produce "thin" edges that are only one pixel wide, the
algorithm scans the entire image and suppresses any pixel that is not a local maximum in its
gradient direction.
4. Double Thresholding: Potential edge pixels are categorized based on two intensity thresholds:
Strong edges: Pixels above the high threshold. Weak edges: Pixels between the high and low
thresholds. Non-edges: Pixels below the low threshold, which are suppressed.
5. Edge Tracking by Hysteresis: This final step decides which weak edges are genuine. A weak
edge pixel is preserved only if it is connected to a strong edge pixel; otherwise, it is discarded
as noise.
What are the steps of Canny Edge Detection Algorithm and explain one of its steps.
• The Canny edge detection algorithm is composed of 5 steps:
1. Noise reduction 2. Gradient calculation 3. Non-maximum suppression
4. Double threshold 5. Edge Tracking by Hysteresis
Noise Reduction
• Edge detection results are highly sensitive to image noise.
• One way to get rid of the noise on the image, is by applying Gaussian blur to smooth it.
• Perform a Gaussian blur on the image.
• The blur removes some of the noise before further processing the image.
• To do so, image convolution technique is applied with a Gaussian Kernel (3x3, 5x5, 7x7 etc…).
2. What is histogram equalization?
Histogram equalization is an important method in histogram modification. Histogram
equalization is often tried to enhance an image.
Why is histogram equalization needed?
-to improve the contrast in an image, in order to stretch out the intensity range.
Explain the histogram of four basic types.
Dark Image- Histogram clustered at the low end, Bright Image - Histogram clustered at the high
end.
Low-contrast image - Histogram with a small spread, High-contrast image - Histogram with
wide spread.
3. Discuss the concept of image filtering.
Image filtering: for each pixel, compute function of local neighborhood and output a new
value. Image filtering is useful for many applications, including smoothing, sharpening,
removing noise, and edge detection, etc.
Which types of noise can be removed by median filtering?
“salt and pepper” noise can be removed by median filtering.
What is the difference between Median filter and Average filter?
Average (or mean) filtering is a method of ‘smoothing’ images by reducing the amount of
intensity variation between neighboring pixels. The average filter works by moving through
the image pixel by pixel. Replacing each value with the average value of neighboring pixels,
including itself. The median filter is a non-linear digital filtering technique, often used to
remove noise from an image or signal. In this filter, we replace the pixel value with the median
value. Edges are better preserved than with linear filters. Best suited for “salt and pepper”
noise.

4. Discuss the methods of Linear Filtering. Among them, which method is used to blur and
reduce noise and then which method is used to smooth out textures. Explain them.

(a) Box
(b) bilinear
(c) Gaussian low-pass filters (or) blurring/smoothing
(d) Sobel
(e) Corner band-pass and oriented filters

Gaussian Filter method is used to blur and reduce noise and then Bilinear Filtering method
is used to smooth out textures.
Gaussian Filter, or Gaussian Blur
A Gaussian filter is a linear filter. It's usually used to blur the image or to reduce noise.
Remove “high-frequency” components from the image (low-pass filter)
The most general function formula is:

Bilinear interpolation is one of the basic resampling techniques in computer vision and image
processing. It is also called bilinear filtering or bilinear texture mapping. Bilinear filtering is a
method of texture filtering design to smooth out textures. Texture filtering or texture smoothing
is the method used to determine the texture color for a texture mapped pixel.

5. Which linear filtering is used to replace each pixel with an average of its neighborhood?
Explain about that filtering.
Box Filtering is used to replace each pixel with an average of its neighborhood. Averaging is
done by convolving image with a normalized box filter. It simply takes the average of all the
pixels under kernel area and replace the central element. We should specify the width and height
of kernel. A Box filter could be of dimensions 3x3, 5x5, 9x9 etc.
A 3x3 normalized box filter would look like below:

Replaces each pixel with an average of its neighborhood. Achieve smoothing effect (remove
sharp features)
6. What is the difference between convolution and correlation in image processing? Why
correlation and convolution are important in computer vision?

Linear filtering of an image is accomplished through an operation called convolution. In


convolution, the value of an output pixel is computed as a weighted sum of neighboring pixels.
The matrix of weights is called the convolution kernel, also known as the filter. In correlation,
the value of an output pixel is also computed as a weighted sum of neighboring pixels. The
difference is that the matrix of weights, in this case called the correlation kernel, is not rotated
during the computation.

Importance:
Feature Extraction (Convolution): Convolutions are used to detect edges, sharpen images, or
blur images by applying specific kernels to highlight patterns.
Template Matching (Correlation): Correlation is used to find a smaller, pre-defined template
within a larger image, useful for object tracking or alignment.
Efficiency and Locality: Both methods are computationally efficient, focusing on small
neighborhoods (local regions) to compute output values.

7. What is edge detection in image processing?


Edge Detection
Goal: Produce a line “drawing” of a scene from an image of that scene.
Identify sudden changes (discontinuities) in an image
Intuitively, most semantic and shape information from the image can be encoded in the edges
More compact than pixels
Ideal: artist’s line drawing (but artist is also using object-level knowledge)
why is it essential for computer vision applications?
Important features can be extracted from the edges of an image (e.g., corners, lines, curves).
These features are used by higher-level computer vision algorithms (e.g., recognition).
Main Steps in Edge Detection
(1) Smoothing: suppress as much noise as possible, without destroying true edges.
(2) Enhancement: apply differentiation to enhance the quality of edges (i.e., sharpening).
(3) Thresholding: determine which edge pixels should be discarded as noise and which should be
retained (i.e., threshold edge magnitude).
(4) Localization: determine the exact edge location.
Outline the fundamental steps involved in edge detection and describe the criteria for achieving
optimal edge detection results
Criteria for Optimal Edge Detection
(1) Good detection
Minimize the probability of false positives (i.e., spurious edges).
Minimize the probability of false negatives (i.e., missing real edges).
(2) Good localization
Detected edges must be as close as possible to the true edges.
(3) Single response
Minimize the number of local maxima around the true edge.

8. How do local features differ from global features in the context of image analysis and
computer vision?
Local features describe distinctive patches or interest points (like corners or edges) within an
image.
Description: Focus on specific interest points or regions.
Robustness: High robustness to deformation, clutter, and partial occlusion.
Examples: SIFT (Scale-Invariant Feature Transform), SURF (Speeded-Up Robust
Features), ORB (Oriented FAST and Rotated BRIEF).
Use Cases: Image matching, 3D scene reconstruction, object recognition, image
stitching/panoramas.
Global features describe the image as a whole to generalize the entire object or scene.
Description: Represent the entire image as a single vector or histogram.
Characteristics: Capture the overall layout, color distribution, or shape contour.
Examples: Histograms of Oriented Gradients (HOG), color histograms, invariant moments,
and structural descriptors.
Use Cases: Content-based image retrieval (CBIR), scene classification, object tracking.
Applications: Local is better for "where" (matching parts), global is better for "what" (identifying
type).

9. What is face recognition?


Facial recognition is a computer vision technology that identifies or verifies a person’s identity
by analyzing unique facial features from images or videos.
Common examples of face recognition technology:
Device Security: Unlocking smartphones (Face ID) and laptops.
Public Safety: Law enforcement identifying suspects in CCTV footage or at airport border
control.
Banking: Verifying identities during digital onboarding or authorizing mobile payments.
Social Media: Automatic photo tagging and augmented reality filters (e.g., Snapchat Lenses).
Enterprise: Tracking employee attendance and controlling access to secure office areas.

10. Explain with example of a real-world application where face detection is utilized.
Face detection is widely used in security and access control systems.
-Secure Device Unlocking
Application: When a user lifts their smartphone, the front-facing camera activates.
Face Detection Example: The device runs a lightweight detection algorithm to identify if a
human face is present in the video frame.
Result: Once the face is detected and localized, the phone initiates the more power-intensive
recognition process, mapping thousands of infrared points to unlock the phone instantly.
- Payment Authorization
Application: Making a secure purchase via apps like Apple Pay or Alipay.
Face Detection Example: To prevent fraudulent transactions, the camera detects the user's face
and, importantly, performs "liveness detection" to ensure it is a real person rather than a photo.
Result: The system authorizes the payment only after validating the detected face matches the
registered user.
-Smart Camera Focus and Exposure (Photography)
Application: The default camera app on smartphones.
Face Detection Example: When taking a portrait, the camera detects faces in the frame and
automatically adjusts the focus and exposure to ensure the faces are bright and sharp, regardless
of background lighting.
Result: Clearer, high-quality photos where the subjects' faces are not over- or under-exposed.

Face detection is widely used for:


Airport Security: uses facial biometrics to match travelers' faces to their passport photos at
boarding gates.
Employee Attendance: Automated attendance systems in offices allow employees to "clock in"
by looking at a camera, which detects them and records their time without physical contact.
Social Media Filters: Apps like Snapchat and Instagram detect facial landmarks (eyes, nose,
mouth) to accurately place virtual filters on a user's face in real-time.
Surveillance: CCTV systems in retail stores or public spaces detect faces to identify known
shoplifters or suspects against a database.

You might also like