This project consists of several tasks related to computer vision, including boundary detection, face detection and recognition, feature detection and image matching, image processing, and image segmentation. Each section below provides images and explanations of the tasks implemented in the project.
- Image Preprocessing
- Boundary Detection
- Features Detection and Image Matching
- Image Segmentation
- Face Detection and Recognition
This is the initial step in the image processing chain, where raw image data is enhanced to improve its quality and remove distortions or artifacts. It prepares the image for further analysis by applying various correction techniques.
Users can manipulate images by introducing various types of noise using a convenient combo box interface. This feature allows for experimentation with different noise models, providing insights into the impact of noise on image quality and subsequent processing algorithms.
We implemented various filters to enhance image quality and reduce noise (e.g. average
, gaussian
, median filter
). We experimented with different kernel sizes, specifically 3x3, 5x5, and 7x7, to observe their effects on the filtration process.
Identifying the boundaries or outlines of objects in the image by detecting changes in intensity.
The histogram of an image gives a graphical representation of the distribution of pixel intensities within that image. It plots the frequency of occurrence of each intensity value along the x-axis, with the corresponding number of pixels having that intensity value along the y-axis. This allows us to visualize how light or dark an image is overall.
Observation: The histogram shows a higher concentration of pixels with lower intensity values, indicating a predominance of dark areas.
The entire GUI is displayed which contains a histogram
, distribution curve
, RGB histogram
, cumulative curve
Observation: We notice a more balanced distribution of intensity values, with a broader spread across the intensity axis. This indicates a wider range of brightness levels present in the image.
Also the entire GUI is displayed which contains a histogram
, distribution curve
, RGB histogram
, cumulative curve
The distribution curve represents the frequency distribution of pixel intensities across the entire image. Peaks in the distribution curve indicate dominant intensity levels, while valleys suggest less common intensity levels.
Observation: We noticed that the curve was skewed towards the higher end of the intensity axis, indicating that the image contains a significant number of bright pixels.
Histogram equalization is a technique used to improve the contrast in an image. It operates by effectively spreading out the most frequent intensity values, i.e., ‘stretching out’ the intensity range of the image. This method usually increases the global contrast of images when its usable data is represented by close contrast values.
Observation: The image appears slightly desaturated and contrasted.
Observation: The image appears more vibrant and bright. The colors are more distinct and saturated, which might make certain details stand out more.
Adjusting the pixel values of an image so that they fall within a specific range or distribution. Normalization helps reduce the effect of variations in illumination, enhancing the contrast of images, and improving the performance of algorithms that operate on image data.
It is a simple and widely used technique in image processing for segmenting an image into two regions: foreground
(object of interest) and background
. The goal is to find a single threshold value
that separates these two regions based on pixel intensity.
Global Thresholding Parameter:
Threshold value
= 109.0
It takes a more nuanced approach. Instead of using a single threshold for the entire image, it computes different thresholds for different regions based on the local characteristics of each pixel’s neighborhood.
Observation: Local thresholding tends to preserve fine details
Global Thresholding Parameter:
Window Size
= 40px
Finding the frequency components of an image through Fourier analysis. The frequency domain provides information about the spatial frequencies present in an image, such as low-frequency components representing smooth areas and high-frequency components representing edges or fine details.
Low Frequency Image
: Marilyn imageHigh Frequency Image
: Einstein image
Boundary detection is the task of identifying the edges and boundaries within an image. It is commonly used in image processing to delineate objects or regions within a scene.
Identifying edges within the images.
Parameters:
Sigma
= 1
Sigma
= 50
For higher sigma value, the image becomes more blurred (more smoothness) and loss of details.
Parameters:
T_low
= 0.05T_high
= 0.09
T_low
= 0.1T_high
= 0.3
- For
lower
valuesT_low
andT_high
: The weak edges appear clearly. - For
higher
valuesT_low
andT_high
: The strongest edges appear clearly and most of the details are lost.
Parameters:
Number of Lines
= 4Neighbor Size
= 10
Observation: The line detection algorithm was applied with a small
number of peaks = 4
, resulting in a reduced number of detected lines
compared to the original lines in the image.
Number of Lines
= 8Neighbor Size
= 10
Observation: The line detection algorithm was applied with a
moderate number of peaks = 8
, resulting in a balanced representation
of lines in the image.
Number of Lines
= 27Neighbor Size
= 10
Observation: The line detection algorithm was applied with a large
number of peaks = 27
, resulting in the detection of one line being
represented as multiple lines, leading to a dense cluster of lines
plotted over it.
Parameters:
Neighbor Size
= 1Number of Lines
= 7
Observation: Using a small neighboring size = 1
, results in detected lines that are closely aligned with the original ones in the image.
Neighbor Size
= 35Number of Lines
= 7
Observation: Using a large neighboring size = 35
, results in a more generalized representation of detected lines compared to the original ones in the image.
Min Radius
= 7Max Radius
= 50Bin Threshold
= 0.6Pixel Threshold
= 20
Min Radius
= 64Max Radius
= 160Bin Threshold
= 0.6Pixel Threshold
= 20
Min Radius
= 17Max Radius
= 100Bin Threshold
= 0.6Pixel Threshold
= 20
Min Radius
= 7Max Radius
= 81Bin Threshold
= 1.0Pixel Threshold
= 100
It is a powerful technique used in image processing for tasks such as object tracking and segmentation. The model works by iteratively adjusting a contour to fit the edges in an image, based on an energy minimization process.
The chain code is a compact representation used in image processing and computer vision to describe the shape of a contour. It simplifies the contour by encoding the direction of transitions between adjacent points along the contour.
It refers to the total length of its boundary. It represents the distance around the shape.
It represents the total surface area enclosed by the contour.
Square Contour
Alpha
= 3Beta
= 96Gamma
= 100Iterations
= 95
Chain code 8
: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, 7, 0, 7, 0, 7, 0, 1, 7, 0, 0, 7, 0, 0, 0, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 4, 5, 4, 5, 4, 4, 5, 4, 4, 5, 4, 3, 5, 4, 4, 5, 4, 4, 4, 4, 3, 7,
0, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1]
Chain code 4
: [0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 1, 1, 1, 1, 1]
Contour perimeter
: 625.86
Contour area
: 28925.50 square units
Square Contour
Alpha
= 3Beta
= 96Gamma
= 92Iterations
= 95
Chain code 8
: [2, 1, 5, 1, 1, 1, 1, 1, 1, 7, 7, 7, 0, 1, 1, 1, 7, 7, 7, 7, 7, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 3, 2, 3, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 7, 5, 6, 6, 6, 7, 6, 6, 5, 6, 6, 5, 5, 5, 5, 5, 4, 4, 4, 0,
4, 0, 4, 4, 4, 4, 4, 0, 4, 4, 0, 0, 4, 4, 0, 0, 4, 4, 0, 0, 4, 4, 4, 4, 4, 0, 0, 4, 4, 0,
0, 4, 4, 0, 0, 4, 4, 0, 0, 4, 4, 0, 0, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 3, 6, 1, 2, 1, 1, 1, 2, 1,
3, 2, 1, 2, 1, 2, 1, 1, 1]
Chain code 4
: [1, 0, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 0, 2, 0, 2, 2, 2, 2, 2, 0, 2,
2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 2, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 2,
2, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1]
Contour perimeter
: 665.76
Contour area
: 22442.50 square units
Circle Contour
Alpha
= 3Beta
= 96Gamma
= 92Iterations
= 95
Chain code 8
: [6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2,
2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 2]
Chain code 4
: [3, 2, 2, 2, 1, 1, 0, 3, 3, 1]
Contour perimeter
: 663.46
Contour area
: 33908.00 square units
Feature detection involves identifying key points in images that are used to match similar images or track objects.
Very Low Threshold
= 0.1
The algorithm detects a large number of corners, resulting in an over-detection scenario.
High Threshold
= 0.8
Applying a high threshold value of 0.8 to the Harris response significantly reduces the number of detected corners to 103, with only a sparse set identified in regions with pronounced intensity variations.
Medium Threshold
= 0.4
A balanced distribution of corners is identified, covering both prominent features and subtle intensity variations.
Threshold
= 0.04block_size
= 2k_size
= 3
Computation time: 0.004015207290649414
Computation time: 0.03145337104797363
Threshold
= 0.04block_size
= 2k_size
= 5
Computation time: 0.004987001419067383
Threshold
= 0.04block_size
= 2k_size
= 7
Computation time: 0.00398564338684082
Threshold
= 0.04block_size
= 3k_size
= 7
Computation time: 0.0030677318572998047
- If you increase the
blockSize
, the window of the neighborhood considered for corner detection becomes larger. - If you increase the
ksize
, the Sobel operator becomes more sensitive to larger, more prominent edges and less sensitive to smaller, finer details. This could result in fewer corners being detected, but those detected may be more robust and significant.
It is a powerful method for detecting and describing local features in images. It is widely used in computer vision tasks such as object recognition, image stitching, and 3D reconstruction. SIFT features are invariant to image scale, and rotation, and partially invariant to changes in illumination and viewpoint.
What we see in the above images are are the Keypoints with their orientation.
Computation_time: 129.2920205593109 sec
Image segmentation is the process of partitioning an image into multiple segments to simplify its analysis. It is commonly used to isolate objects or regions of interest in an image.
block_size
= 20
In regions with intricate details or sharp-intensity transitions, smaller blocks can capture nuances more effectively.
block_size
= 50
With a moderate block size, a balance between local analysis and computational efficiency is achieved.
The segmentation results tend to be smoother compared to smaller block sizes due to averaging effects over larger regions.
block_size
= 80
Larger block sizes lead to more global analysis of pixel intensities, encompassing broader regions within the image.
block_size
= 50
block_size
= 80
number of classes
= 2
number of classes
= 3
Increase the number of classes more and more
With each increment in the number of classes, the algorithm will compute an additional threshold value. These thresholds aim to segment the image into more distinct intensity levels or regions.
And because the image has almost three peaks, if the chosen number of classes equals 3
the algorithm will allow for finer segmentation.
And if we increase it more and more may lead to wasted computational resources and potentially noisy segmentation results, It's generally advisable to choose the number of classes based on the information present in the histogram of the image.
Smaller Window Size
= 25
Larger Window Size
= 70
# Clusters
= 2# Iterations
= 15
# Clusters
= 5# Iterations
= 15
Threshold
= 4
Threshold
= 50
As the threshold increases the segmented region is expected to grow progressively larger, incorporating more neighbouring pixels that meet the heightened similarity criterion.
Clusters
= 10Threshold
= 15
Clusters
= 5Threshold
= 15
Increasing the number of clusters will result in a greater number of clusters in the output image. Each cluster will represent a distinct color group, potentially leading to finer details but also increasing complexity.
Clusters
= 10Threshold
= 50
Clusters
= 10Threshold
= 15
A higher initial number of clusters leads to finer initial clustering, potentially capturing more subtle color variations in the image. However, it may also increase the computational complexity of the algorithm.
Bandwidth
= 60
Bandwidth
= 180
Bandwidth
= 350
Face detection involves identifying human faces in digital images. Face recognition goes a step further by identifying or verifying individuals based on facial features.