Software Engineering part 3 assignment for The University of Auckland, handling Image Processing
This project involves developing a Python pipeline to detect and outline coins in images using techniques such as greyscale conversion, edge detection, blurring, thresholding, morphological operations, connected component analysis, and drawing bounding boxes. An extension includes advanced methods for harder images and coin identification.
- Convert to Greyscale: Convert the RGB image to greyscale using the ratio 0.3 * Red + 0.6 * Green + 0.1 * Blue, and round the pixel values to the nearest integer.
- Contrast Stretching: Stretch the values between 0 to 255 using the 5-95 percentile strategy.
- Scharr Filter: Apply a 3x3 Scharr filter in horizontal and vertical directions to get edge maps.
- Edge Strength: Compute the absolute value of the sum of horizontal and vertical edge maps.
- Mean Filter: Apply a 5x5 mean filter to the image, taking the absolute value after computing each window and applying the filter three times sequentially.
- Thresholding: Perform a simple thresholding operation to segment the coins from the background, resulting in a binary image.
- Morphological Operations: Perform several dilation steps followed by erosion steps using a circular 5x5 kernel to refine the binary image.
- Component Analysis: Perform connected component analysis to find all connected components in the binary image.
- Bounding Boxes: Extract bounding boxes around all detected coin regions by identifying the minimum and maximum x and y coordinates of the pixels in each connected component.
- Laplacian Filter: Use the Laplacian filter for edge detection.
- Hard-Level Images: Test the pipeline on harder images and possibly identify coin types based on size.
- Coin Counting and Identification: Output the number of detected coins and identify their types (e.g., 1-dollar coin, 50-cent coin) based on their size.
- [Python]
Before running the project, ensure you have the following installed:
-
Python: Ensure you have Python 3 installed. You can download it from python.org.
-
Matplotlib: The only external library allowed for the main component is Matplotlib. You can install it using pip:
pip install matplotlib
This Coin Detection Assignment was an intensive project aimed at enhancing my Python programming skills and understanding of image processing techniques. I embarked on this project to deepen my knowledge in computer vision and its practical applications. It provided an excellent opportunity to expand my expertise in technical aspects as well as in designing effective algorithms.
The primary goal was to develop a comprehensive pipeline for detecting and outlining coins in images. The project involved implementing various image processing steps, including greyscale conversion, edge detection, image blurring, thresholding, morphological operations, and connected component analysis. An additional objective was to extend the pipeline to handle more challenging images and identify different types of coins based on size.
A significant challenge was ensuring the accuracy and robustness of the coin detection pipeline across different image complexities. This required extensive experimentation with various image processing techniques and fine-tuning parameters. Addressing these issues improved my understanding of computer vision concepts and enhanced my problem-solving abilities. Moreover, I learnt the importance of usability, memorability, and emotional impact in designing a user-friendly system. Integrating Nielsen's heuristics and principles of design such as unity, balance, and emphasis into the pipeline was crucial in achieving a seamless user experience.