def drawsmoothprojection(self, frame): x, y, w, h = self.bound_rect y_pro = self.smooth_projection[0] for i in range(len(y_pro)): cv2.circle(frame, (x + w + y_pro[i], y + i), 1, (0, 255, 0)) x_pro = self.smooth_projection[1] for j in range(len(x_pro)): cv2.circle(frame, (x + j, y + h + x_pro[j]), 1, (0, 255, 0))
def drawmeanprojection(self, frame): x, y, w, h = self.bound_rect y_mean = self.mean[0] for i in range(h): cv2.circle(frame, (x + w + y_mean, y + i), 1, (255, 255, 255)) x_mean = self.mean[1] for j in range(w): cv2.circle(frame, (x + j, y + h + x_mean), 1, (255, 255, 255))
def drawmeanprojection(self, frame): x, y, w, h = self.bound_rect x_mean = int((self.mean[0] * 2) / 3) y_mean = int(self.mean[1] / 2) for i in range(h): cv2.circle(frame, (x + w + x_mean, y + i), 1, (255, 255, 255)) for j in range(w): cv2.circle(frame, (x + j, y + h + y_mean), 1, (255, 255, 255))
def painttop(self, frame): cv2.circle(frame, self.top, 2, (255, 255, 0), thickness=2, lineType=8)
def paintbase(self, frame): cv2.circle(frame, self.base, 2, (255, 255, 0), thickness=2, lineType=8)
def paintcircle(self, frame): (x, y), radius = self.circle center = (int(x), int(y)) radius = int(radius) cv2.circle(frame, center, radius, (0, 255, 0), 2)