Lines Matching refs:cv2
25 import cv2
39 return cv2.warpAffine(a, T, (w, h), borderMode = cv2.BORDER_REFLECT)
53 w, h = map(cv2.getOptimalDFTSize, [x2-x1, y2-y1])
57 img = cv2.getRectSubPix(frame, (w, h), (x, y))
59 self.win = cv2.createHanningWindow((w, h), cv2.CV_32F)
62 g = cv2.GaussianBlur(g, (-1, -1), 2.0)
65 self.G = cv2.dft(g, flags=cv2.DFT_COMPLEX_OUTPUT)
70 A = cv2.dft(a, flags=cv2.DFT_COMPLEX_OUTPUT)
71 self.H1 += cv2.mulSpectrums(self.G, A, 0, conjB=True)
72 self.H2 += cv2.mulSpectrums( A, A, 0, conjB=True)
78 self.last_img = img = cv2.getRectSubPix(frame, (w, h), (x, y))
86 self.last_img = img = cv2.getRectSubPix(frame, (w, h), self.pos)
89 A = cv2.dft(img, flags=cv2.DFT_COMPLEX_OUTPUT)
90 H1 = cv2.mulSpectrums(self.G, A, 0, conjB=True)
91 H2 = cv2.mulSpectrums( A, A, 0, conjB=True)
98 f = cv2.idft(self.H, flags=cv2.DFT_SCALE | cv2.DFT_REAL_OUTPUT )
111 cv2.rectangle(vis, (x1, y1), (x2, y2), (0, 0, 255))
113 cv2.circle(vis, (int(x), int(y)), 2, (0, 0, 255), -1)
115 cv2.line(vis, (x1, y1), (x2, y2), (0, 0, 255))
116 cv2.line(vis, (x2, y1), (x1, y2), (0, 0, 255))
125 C = cv2.mulSpectrums(cv2.dft(img, flags=cv2.DFT_COMPLEX_OUTPUT), self.H, 0, conjB=True)
126 resp = cv2.idft(C, flags=cv2.DFT_SCALE | cv2.DFT_REAL_OUTPUT)
128 _, mval, _, (mx, my) = cv2.minMaxLoc(resp)
130 cv2.rectangle(side_resp, (mx-5, my-5), (mx+5, my+5), 0, -1)
143 cv2.imshow('frame', self.frame)
149 frame_gray = cv2.cvtColor(self.frame, cv2.COLOR_BGR2GRAY)
159 frame_gray = cv2.cvtColor(self.frame, cv2.COLOR_BGR2GRAY)
167 cv2.imshow('tracker state', self.trackers[-1].state_vis)
170 cv2.imshow('frame', vis)
171 ch = cv2.waitKey(10) & 0xFF