Identifying Simple Shapes
MATLAB
Individual: 05/14/2021

Overview
This code will be able to identify simple shapes, such as rectangles and circles, and will measure their lengths/diameters. This will be done by separating the shapes from the backgrounds and then analyzing the shapes individually. These calculations are important because it gives the foundational basis for which this code to be extended to, such as facial recognition. Furthermore, it is impossible to measure the height of skyscrapers, so this code would provide a method to find the height of tall buildings and
other landmarks.
Technical Approach
I started by creating a binary image, which is essentially an array consisting of 0’s and 1’s where the 1’s will be the portions of the image including the shape. I created more images that just make it easier for the user to visualize what shapes exactly the program is detecting and then analyzing. Then, I made the code detect each shape and determine whether each is a rectangle, circle, or triangle. After determining the shape, the measurements of each shape were taken by using separate functions. If the user would like the measurements to be converted to real-world units, they are given the option at the end.

Future Work
Possible next steps would be to…
-
Detect the color of the shapes
-
Detect other shapes
It is also possible to make the user draw a shape on the image and make the program measure its real-world length/distance. This way, it would be less likely for there to be an error in separating the shapes from the backgrounds. This is especially useful for unusually shaped buildings or images with busy backgrounds (trees, cars, etc.). I did not do this, however, because I wanted the code to be less reliant on the user.