Barcode detection on grocery items
Steps to Run:
- Run hsv_seg.py --images path/to/image/folder
Requirements: OpenCV-Contrib version 4.5.4
Input Image | Predicted Result |
---|---|
Prediction Print
Object Detection
- HSV Segmentation + edge detection to extract foreground.
- Morphological operations to get a better mask.
- Find contours and fit Rectangle to get Bounding Box.
- Crop item using B-Box
- Send the detected boxes(groery items) for barcode detection.
Barcode Detection
- OpenCV Barcode detector (from OpenCV-Contrib 4.5.4 package)
- Run detection on item, store detections.
- Display decoded barcodes with their count. (Draw Blue B-Box around them)
- Draw Yellow B-Box around Undecoded barcodes.
- Draw Red B-Box around item with no detected barcode.