Image Processing Assessment
Overview
This report is presents the usage of image processing methods that can be used to analyze
and classify objects within medical images, including blood cells and bacteria. The tasks are as
follows: Task 1, Task 2, Task 3, Task 4, Task 5, Task 6, and all these tasks are from the image
pre-processing to the performance evaluation. In Task 1, the image was preprocessed for analysis
by converting it to black and white, normalizing the height and increasing the contrast. In Task 2,
edge detection was performed with the help of different algorithms, such as Sobel, Prewitt,
Roberts, and Canny; however, canny algorithms yielded the best results. In Task 3, edgedetection was done on the blood cell image to separate the cells, and the holes were filled in the
segmented image while eradicating noise to give a binary image.
In Task 4, objects were either blood cells or bacteria depending on the size and shape and
they were labelled by colors. Task 5 fine-tuned the segmentation method in order to be more
immune to variations in different images. Last of all, Task 6 was to compare the segmentation
results with the ground truth data and this was done by using the Dice Score, Precision, and
Recall. Combined, these tasks show a step by step process of how to segment and classify
biological structures in images.
Task 1: Pre-Processing
Task 1 presents image pre-processing techniques that are used to prepare an image for
analysis. The process is significant in standardizing the image, and improving it for detection and
analysis in subsequent tasks. The process started by loading the input image (IMG_1.png) into
MATLAB environment using the code I = imread('IMG_01.png'); The image was
then converted to grayscale to reduce the analysis to intensity values only and exclude any color
data that could be irrelevant. This made the image less complex and easier to process. Next, the
grayscale image was resized to a height of 512 pixels while keeping the aspect ratio. This
standardizes the size of the image so that the processing is consistent across the datasets and it
reduces distortion, which affects the detection.
To improve the image I used the imadjust function to increase the contrast of the image.
This technique extended the dynamic range of the image, that is, increased the contrast between
the light and dark regions of the image. Consequently, elements like blood cells and bacteria
were emphasized, which enhanced their subsequent binarization and segmentation. Also, I
applied a smoothing filter to eliminate noise. This filter reduced unnecessary small features while
keeping edges of the objects of interest and maintaining their integrity. The improved image was
then converted to a binary image through thresholding in order to distinguish between the objects
and the background. To clean up the image, I applied morphological operations to eliminate
small noise, and got a clear and well-separated binary image.
Figure 5 shows a histogram indicating the pixel intensity of the resized grayscale image.
The majority of pixel intensities are at lower end of the scale, which means that the image is
predominantly dark with not much contrast.
Figure 6 displays the histogram after contrast has been adjusted. The intensity range has
increased a bit and the contrast between the light and dark regions is far more distinct. This
enhancement helps to make objects such as blood cells or bacteria more recognizable to other
processes such as binarization and segmentation. The transformation is necessary to have better
visibility of the objects which is important when analyzing the image.
Figures 1 through 6 shows the results of task 1.
Task 1 Output
Figure 1 Original Image
Figure 2 : Grayscale Image
Figure 3: Resized Grayscale Image
Figure 4: Enhanced Grayscale Image
Figure 5: Histogram of Resized Image
Figure 6: Histogram of Enhanced Image
The tests of the pre-processing strategy on other images showed some problems, for
instance noisy detections due to light in homogeneities or additional features. Increasing contrast
and decreasing noise were found to be beneficial, as they contributed to higher object separation
and better detection. These steps show that image enhancement is crucial in providing proper and
reliable analysis of different data sets.
Task 2: Edge Detection
Edge detection is one of the most important processes in image analysis, which allows to
determine the outlines of objects in the image. For task 2, I used the enhanced grayscale image
from Task 1 as it was efficient in edge extraction. The objective was to emphasize the outlines of
the objects, like blood cells or bacteria, for further examination. Edge detection enhances the
quality of object recognition and segmentation; therefore, it is an essential step in medical and
biological image analysis. Also, it has a significant role in decreasing the difficulty of the next
steps by lessening the shapes of objects but maintaining important features.
I used four edge detection methods: Sobel, Prewitt, Roberts and Canny. Sobel and
Prewitt find edges based on gradients and are fast, but they are not very good at removing noise
which causes false edge detection. However, since Roberts is very sensitive to noises, it tends to
emphasize on unwanted features; therefore it is not suitable for noisy or uneven illumination
conditions. Canny, however, is considered to be the best edge detection algorithm. It employs
gradient calculation, non-maximum suppression to discard weak edges, and edge tracking
through hysteresis to link related edge segments. This makes Canny highly effective in detecting
continuous and clean edges, free from noise.
I chose Canny method Technique because it generated better and smoother edges than the
other methods used in the research. The Canny method is useful for obtaining clear edges and
eliminating unnecessary information and noise since the subsequent segmentation and object
recognition processes require accurate input. This capability is especially valuable in medical
imaging where the precision and accuracy is necessary for studying biological tissues and
detecting pathologies.
Task3 – Simple Segmentation
Segmentation is a technique in image processing where by objects of interest are
separated from their background. It converts an image into its basic constituent components,
which makes it easier to study particular areas of the image such as blood cells in medical
images. This technique is used in order to find and select objects of interest, which helps to
analyze them in detail while excluding any extraneous information.
For this task, I segmented blood cells using the canny edge-detected image. First, I
employed the edge-detected image as input for segmentation. Then, small holes within objects
were filled using the imfill function. In order to minimize the noise, objects of size less than
50 pixels were eliminated. Finally, a binary image was shown with blood cells only on the black
background. These steps helped to achieve clear distinction of objects of interest, which
enhanced the precision of the further analysis. Segmentation process shows how crucial is the
correct preprocessing and noise removal when finding the required details in medical images to
provide accurate results for the subsequent object recognition and classification.
Figure 7: Final Segmented Image (Blood Cells)
Task 4: Object Recognition
In Task 4, I opted to use the image file IMG_11.png to distinguish and identify blood
cells and bacteria. First, I converted the image to grayscale and then used imadjust to increase
the contrast of the image so that the features are more distinguishable. Next, I applied Otsu’s
thresholding to binarize the enhanced image because it does a good job of segmenting objects
from the background. The bwlabel function was used to label connected components, and the
area and centroid of each region of interest was determined using regionprops for classification.
Objects were classified based on their size: the larger areas referred to blood cells while
the smaller areas referred to bacteria. Last, the results were presented with blood cells in red and
bacteria in blue and a segmented image on black background with low noise intensity. This
method is very effective in accurate identification of the objects of interest, which is very
important in biological image analysis and any application where there is need to distinguish
between two different objects.
Task 5: – Robust Method
The first step involved pre-processing where the input image, in this case IMG_12, was
loaded into MATLAB so as to prepare it for analysis. Looking at the original image, it is easier
to determine features that may be important and how to segment and classify them.
Subsequently, the image was converted to grayscale, which makes the subsequent analysis easier
since only the pixel intensity values are considered and the color data are unnecessary. This helps
in reducing the computational load and also brings the image in an optimal state for further
enhancement and thresholding.
The imadjust function increases the contrast of the image and makes objects in the
grayscale image more visible, for instance, blood cells and bacteria while reducing the
background noise. This step helps in achieving better segmentation between objects and their
background. The grayscale image is then converted to a binary format by applying Otsu’s
thresholding technique that automatically determines the best threshold for the segmentation of
the objects of interest. To enhance the image further, the noise and small undesired objects are
erased using the bwareaopen function which removes all components less than a specified
size, thus minimizing on false positives.
I applied bwlabel to label each object connected in the binary image and regionprops
is applied to measure the area, perimeter, and centroid of the objects. These properties are helpful
for discriminating between blood cells and bacteria. Lastly, objects are classified as circular or
non-circular based on the ratio of the area of the object to the perimeter of the object. By using
the color red to highlight circular shapes such as blood cells and blue color to highlight irregular
shapes such as bacteria. The last segmented image is the most appropriate one to show the
classified objects because their identification is accurate and enables additional processing.
The final output figure 11 shows a binary image that has been divided into segments and
each segment represents the objects of interest such as blood cells and bacteria. The colored
regions (e.g., green, orange, blue) are segmented objects where each color is associated with a
different connected region. These regions were named according to their geometrical
characteristics like area and boundary. The red circles represent objects identified as blood cells,
which have high circularity (round) shapes. On the other hand, the blue circles represent objects
that are labeled as bacteria and these do not have round shapes or are less round than the other
shapes. This visualization helps to explain how the method of segmentation and classification
works and how it separates blood cells from bacteria.
Figure 8: Original IMG 11
Figure 9: Grayscale IMG 11
Figure 10: Binarized Image using Otsus Method
Figure 11: Segmented Object
Task 6: Performance Evaluation Report
Overview
In Task 6, the performance of the segmentation system for blood cell and bacteria detection is
assessed by using Dice Score, Precision, and Recall. The evaluation was done with the ground
truth file IMG_12_GT.png and segmented outputs. This report discusses the findings, problems,
and recommendations.
1. Evaluation Metrics
The evaluation yielded the following results:
Blood Cells:
Dice Score: 0.3718
Precision: 0.7564
Recall: 0.2465
Bacteria:
Dice Score: 0.0000
Precision: 0.0000
Recall: NaN (No True Positives identified)
2. Observations
Blood Cells:
The segmentation system has a reasonable Precision of 0.7564, which means that most of the
regions detected in the blood cell images are accurate.Recall (0.2465) was low, this means that
many true blood cell regions were not detected.
Bacteria:
The system was able to recognize no bacteria at all and therefore it scored zero on Dice Score,
Precision and Recall. This suggests segmentation and classification difficulties for small or
complexly shaped objects.
3. Challenges
1. Low Recall for Blood Cells:
Omitted areas because of different segmentation levels or an incomplete outline of the object of
interest.
2. Zero Detection for Bacteria:
Because of their small size and irregular shapes, bacteria are often indistinguishable from noise.
It can be observed that there are some problems with the thresholding methods in that bacteria
may not be isolated well in the image.
3. Ground Truth Limitations:
There might be some differences in evaluation due to the fact that the ground truth file may not
map some of the objects accurately.
4. Enhancements Implemented
Contrast Enhancement:
Adapthisteq enhanced visualization of objects with different intensities.
Noise Reduction:
Some morphological operations like bwareaopen were applied to eliminate small noises that
were not significant.
Geometric Analysis:
Classification based on circles was useful in distinguishing round blood cells from irregular
bacteria.
5. Recommendations
1. Bacteria Detection:
For better detection of small objects, one can employ region growing or watershed algorithms for
more accurate segmentation. Try out the morphological operations that are particularly designed
for the irregular shapes.
2. Performance Improvement:
Integrate machine learning models that are trained to identify blood cells and bacteria from the
image features. Apply edge detection techniques for enhancing the definition of the object
contours.
3. Evaluation Refinements:
It is suggested to store the metrics to structured files in order to improve result tracking and
reproducibility. Cross check the results with more than one ground truth dataset to confirm the
outcome.
6. Comparative Analysis
The current method uses global and adaptive thresholding, which is very basic and becomes
problematic in complex situations such as small object detection (bacteria).Segmentation could
be improved using machine learning based or deep learning based methods that could learn
object specific features.
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )