Digital Image Processing Geometric and Shape Properties of The Regions
Digital Image Processing Geometric and Shape Properties of The Regions
1 Introduction
Geometric features play a crucial role in characterizing shapes and structures
in various fields such as image processing, computer vision, and pattern recog-
nition. This report aims to provide an overview and analysis of key geometric
features commonly used in these domains.
1
• Extremal Axis Length from Bounding Box: This feature measures
the length of the longest diagonal within the bounding box, providing an
indication of the shape’s overall size.
• Second Order Moments: These moments describe the distribution of
mass or intensity within a shape and are used to calculate parameters such
as orientation and eccentricity.
• Lengths and Orientations of Axes of Best-Fit Ellipse: This feature
involves fitting an ellipse to the shape and analyzing its major and minor
axes, providing valuable information about the shape’s orientation and
elongation.
3 Utilized Image
A single binary image containing a rectangle was utilized as the basis for im-
plementing and evaluating the extraction of geometric properties. This section
provides details about the utilized image and its characteristics.
2
Figure 1: Rectangle Object
4 Methodology
4.1 Area
• Utilize a binary image containing objects, where the object of interest is
represented by non-zero pixel values (foreground).
• Initialize area variable to zero.
• Iterate through each pixel in the binary image.
• the pixel value is non-zero, increment area by one.
• Final area value represents the total object area.
4.2 Centroid
• Iterate through each pixel in the binary image.
• If the pixel value is non-zero:
• Increment sum x by the x coordinate of the current pixel.
• Increment sum y by the y coordinate of the current pixel.
• Calculate the centroid coordinates:
PN
• Centroid x = A1 i=1 xi
PN
• Centroid y = A1 i=1 yi
• The centroid coordinates (Centroid x, Centroid y) represent the center of
mass of the object in the binary image.
3
4.3 Perimeter
• Apply the erosion operation to the binary image using a suitable struc-
turing element, such as a 3x3 or 5x5 square.
• Subtract the eroded image from the original binary image to obtain the
boundary pixels of the object.
• The resulted image will contain the perimeter of the object
4.5 Circularity
• Calculate the area, A, and the perimeter, P, of the object using the pre-
viously described methods.
|p2 |
• Compute the circularity using the formula: C = A
4.6 Elongation
• Identify coordinates of object pixels in the binary image.
• Determine the minimum and maximum coordinates of the object.
• Compute lengths of the minimum and maximum coordinates.
4
4.7 Mean and Standard Deviation of Radial Distance
• Calculate the radial distance of each object pixel from the centroid;
• Calculate the mean of the radial distances.
• Construct the bounding box using the minimum and maximum coordi-
nates.
• Optionally, visualize the bounding box overlaid on the original image for
verification or analysis.
• Measure the length of the longest and shortest axes of the bounding box.
• Determine which edges of the bounding box correspond to the longest and
shortest axes.
• Extract the lengths of the extremal axes from the bounding box dimen-
sions.
5
– Column Moment (b′ ): Square the row indices of object pixels and
sum them.
– Mixed Moment (c′ ): Multiply the row and column indices of object
pixels element-wise and sum them.
• Step 3: Calculate Object Center: Compute the object center by
taking the average of x and y coordinates of the object pixels.
• Step 4: Calculate Total Number of Object Pixels: Determine the
total number of object pixels, which represents the object area.
• Step 5: Adjust Moments with Respect to the Center: Adjust the
calculated moments with respect to the object center:
– Row Moment (a): Subtract the squared center x-coordinate mul-
tiplied by the total number of object pixels from a′ .
– Column Moment (b): Subtract the squared center y-coordinate
multiplied by the total number of object pixels from b′ .
– Mixed Moment (c): Subtract the product of the center x-coordinate
and center y-coordinate multiplied by the total number of object pix-
els from c′ .
6
5 Results
5.1 Area
• The area of the rectangle in binary image is 18352 in term of pixels
5.2 Centroid
• The centroid of the rectangle object is;
– Centroid x: 127.5
– Centroid y: 127.5
and as shown in Figure.2
5.3 Perimeter
• The Perimeter of the Rectangle object is shown in Figure.3
5.5 Circularity
• The circularity of the rectangle in the image we use is 0.1194
• As the circularity value is near to zero this means that the object is far
from circle shape.
5.6 Elongation
• The Elongation is 1.6849 so it means that one of the axis is greater than
the other.
• This value show that the object is a rectangle object
7
Figure 2: Centroid
• This value show the width of the bounding box as it has greater width
than height
• Now these values shows that the column moment is greater than the row
moment so there will be less effort during row moment of the object than
column.
8
Figure 3: Perimeter
9
• The mixed moment is zero because the distribution of pixels to the left
and right of the centroid, as well as above and below it, is equal.
6 Conclusion
• Our task involved examining the shapes and geometric properties of ob-
jects within binary images—images where everything is either black or
white. We scrutinized properties such as size, position, and overall shape
of these objects.
• By gauging these properties, we acquire insights into the distinct features
of each object. For example, we can discern whether an object is more
elongated or more circular compared to others in the image. This type
of analysis aids in accurate identification and categorization of objects,
which holds significance for various applications like object detection in
autonomous vehicles or cell segmentation in biomedical imaging.
• Our task establishes a robust foundation for future endeavors in image
analysis. These methodologies can be implemented across diverse fields
where comprehending the shapes and structures in images is paramount.
Ultimately, our efforts contribute to enhancing the capabilities of image
processing techniques, fostering more precise and efficient analysis in a
multitude of domains.
10