How we can count triangles in this image:
First, we need to remove color noise. Then we can try cv2.Canny and cv2.findCountours. But how cv2.findCountours distinguish individual crossing shapes?
I tried this:
img = cv2.fastNlMeansDenoisingColored(img, None, 6, 6)
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (3, 3))
img = cv2.morphologyEx(img, cv2.MORPH_CLOSE, kernel)
Bad result…