- Count the number of segregated colored trash bags
Step 1
- Input image
- convert BGR to HSV
- finding fixed colors, Blue, Yellow , Red, Green
- Specifying RGB/HSV Boundaries : lower / upper
Step 2
- creating mask of image by cv2.inRange(image, lower, upper)
- Applying the masking to residual img by cv2.bitwise_and
Step 3
- RGB Channels split & convert HSV 2 Gray
- Gaussian Blur
Step 4
Corner Edge Detection
- Canny edge detection
Morphological Transformations
- Dilation
- Erosion
Step 5
- find and count countours on edged image
- Defining Countour AREA
- Convex hull boundaries
- Draw contours i.e. mark all findings with different colors
python color_segment.py -i garbagebags2.jpg -o output.png -c hsv
python color_segment.py -i garbagebags2.jpg -o output.png -c rgb