Computer Vision SM-2
Computer Vision SM-2
BELGAUM
COMPUTER VISION
STUDY MATERIAL
VI-SEMESTER
1
Computer Vision BCS613B
MODULE -2
Syllabus: Image processing: More neighborhood operators, Fourier transforms, Pyramids and
wavelets, and Geometric transformations
MODULE -2
Neighborhood operators go beyond traditional linear filtering techniques and include non-
linear filters that are more effective at preserving image structures such as edges while
removing noise.
• Median filtering is a non-linear filter that replaces each pixel with the median value
from its neighborhood.
• It is highly effective for salt-and-pepper noise (impulse noise) because the extreme
values are ignored.
• Unlike Gaussian smoothing, median filtering preserves edges because it does not
average intensities.
• Computational efficiency:
o A median filter can be computed in O(n log n) time using sorting.
o Optimized implementations (e.g., Perreault and Hébert, 2007) can compute it in
constant time.
Example of Median Filtering
Original noisy image (5×5 window):
[ 8, 7, 255, 8, 9]
[ 7, 6, 255, 7, 8]
[ 6, 5, 255, 6, 7]
[ 7, 6, 255, 7, 8]
[ 8, 7, 255, 8, 9]
Sorted values in the 3×3 window:
[6, 6, 7, 7, 7, 7, 8, 8, 9]
Output pixel = 7 (Median value)
2.1.2 α-Trimmed Mean Filter
• It is a combination of mean and median filtering.
• Instead of using all pixels, it discards the α-fraction of extreme values and averages
the rest.
• It helps in cases where Gaussian noise dominates but impulse noise is present.
Example Calculation
For a 5×5 window, if α = 20%:
1. Sort the values.
2.2.3 Interpretation
• Pixels that are spatially close and intensity-similar contribute more.
• Unlike median filters, it does not completely discard different pixels but weights them
less.
2.2.4 Example
Pixels Weights
20 0.8
22 0.9
100 0.05
21 0.85
• Applications:
o Object segmentation
o Feature extraction
o Skeletonization (medial axis computation)
2.3.4 Connected Component Analysis
• Identifies groups of connected pixels.
• Methods:
o N4 connectivity (horizontal + vertical).
o N8 connectivity (includes diagonal).
Example Application: OCR
• Segments letters from scanned text images.
2.3.4 Summary
• Non-linear filtering outperforms linear methods in preserving edges.
• Bilateral filtering is a powerful method for edge-aware smoothing.
• Binary image processing enables morphological operations and object segmentation.
2
h(x) = 𝑒 −𝑥
has a Fourier Transform:
2
H(ω)= 𝑒 −ω
This means that a Gaussian function in the spatial domain remains a Gaussian function in
the frequency domain.
2.4.4.2 Discrete Fourier Transform (DFT)
Since images and signals are discrete, we use the Discrete Fourier Transform (DFT):
Example:
Example
Example
High (overcomplete
Redundancy Low (compact representation)
representation)
where:
Example
Example:
Shifting an image by (50, 30) pixels moves each pixel 50 units right and 30 units down.
2.6.2.2 Scaling
• Changes the size of an image.
In Matrix form:
Example:
Scaling an image by Sx = 2, Sy = 1.5 makes it twice as wide and 1.5 times taller.
2.6.2.3 Rotation
Rotates an image around the origin by θ degrees.
Using trigonometric functions:
Matrix Form
Example:
Rotating an image by 90° counterclockwise swaps x and y coordinates.
2.6.3.4 Shearing
Example Uses
1. Face Detection: Detect faces at different scales.
2. Template Matching: Align objects in images.
3. Optical Character Recognition (OCR): Normalize text images.
2.6.5 Projective Transformations (Homography)
• Extends affine transforms to preserve straight lines but not parallelism.
• General form
Example Uses
1. Panoramic Stitching: Aligns overlapping images.
2. Perspective Correction: Rectifies tilted images.
3. Augmented Reality (AR): Maps virtual objects onto real-world images.
2.6.6 Non-Linear Transformations
• Warping: Distorts images non-linearly.
• Thin-Plate Splines: Used for facial expression transfer.
Example Uses
1. Medical Imaging: Warping scans for alignment.
2. Facial Recognition: Normalizing expressions.
2.6.7. Interpolation Methods
Since geometric transformations map pixels to non-integer locations, interpolation is needed.
2.6.7.1 Nearest Neighbor Interpolation
2.6.9 Conclusion
• Geometric transformations enable image scaling, rotation, translation, and warping.
• Affine and projective transformations are widely used in computer vision tasks.
• Interpolation techniques ensure smooth transformation results.
• Applications include panoramic stitching, face detection, and OCR.
Important Questions
1. Demonstrate various types of neighborhood operators with examples.
2. Given an image with noise, apply Fourier Transform technique to improve its quality.
Explain your choice
3. Given a distorted image, explain how you would apply geometric transformations
image transformations to correct and enhance the image. Provide real-world examples
where such transformations are crucial in image processing applications.
4. You are given an image with multiple objects of varying sizes. How would you use
image pyramids and wavelet transforms to perform object detection efficiently?
Explain your approach with practical examples where multi-scale analysis is essential.
5. What is bilateral filtering, and how does it help in edge-preserving smoothing? How is
it different from median filtering?
6. Why is Fourier Transform important in image processing? How does it help in image
enhancement and compression?
7. How does Optical Character Recognition (OCR) benefit from geometric
transformations? What role does interpolation play in improving image quality?
8. What is a Laplacian pyramid in image compression? How does it compare with
wavelet-based compression techniques like JPEG2000?
9. How are high-pass and low-pass filters used in medical imaging? What aspects of
medical images do they improve?
10. What are non-linear geometric transformations like warping? How are they useful in
medical imaging, augmented reality, and facial recognition?
6. Why is Fourier Transform important in image processing? How does it help in image
enhancement and compression?
Importance of FT in Image Processing:
• Converts an image into frequency components.
• Useful for denoising, edge detection, and compression.
Applications:
• Enhancement: High-pass filtering sharpens images, and low-pass filtering removes
noise.
• Compression:
9. How are high-pass and low-pass filters used in medical imaging? What aspects of
medical images do they improve?
• High-Pass Filters:
o Enhance sharp details like edges.