The project provides a script to read an image and draw objects contours.
- Shadow effect: use dark background
- Object boundry: use contrasting background
- Java 8 (maybe or higher)
- Maven
- Clone repository
git clone https://github.com/evosystem-jp/objectSizeMeasurer.git
- Install dependencies
mvn install
mvn exec:java -Dexec.mainClass="jp.evosystem.objectSizeMeasurer.mains.ImageFileObjectSize"
mvn exec:java -Dexec.mainClass="jp.evosystem.objectSizeMeasurer.mains.VideoFileObjectSize"
mvn exec:java -Dexec.mainClass="jp.evosystem.objectSizeMeasurer.mains.WebCameraObjectSize"
- Image pre-processing
- Read an image and convert it it no grayscale
- Blur the image using Gaussian Kernel to remove un-necessary edges
- Edge detection using Canny edge detector
- Perform morphological closing operation to remove noisy contours
- Object Segmentation
- Find contours
- Remove small contours by calculating its area (threshold used here is 100)
- Sort contours from left to right to find the reference objects
- Compute results
- Draw bounding boxes around each object and calculate its height and width
- Evosystem, Inc.