How to detect an octagonal shape in Python and Opencv
问题 I am working on a shape detection algorithm with opencv in python . I am using Contours from the library and I have had some shapes being detected successfully: Circle, Rectangle and Triangle. The only problem is that I only need to detect circles rectangles and octagons. Also, the circle was working, but inconsistently. So, this is my code: import cv2 import numpy as np def nothing(x): # any operation pass cap = cv2.VideoCapture(1) cv2.namedWindow("Trackbars") cv2.createTrackbar("L-H",