Shape Detection in python using OpenCV
问题 I'm working on a project in which I use OpenCV to detect shapes and their colors. There are 5 colors (red, green, yellow, blue and white) and 4 shapes (rectangle, star, circle and heart). I've been able to reliably discern the colors and I can detect the shapes when the image used is a drawn image like this using this code. Note, the image is for demonstration only, the range values in my code are not for these colors. import cv2 import numpy as np class Shape(): def __init__(self, color,