(self, img)
| 11 | self.T = T |
| 12 | |
| 13 | def detect(self, img): |
| 14 | # convert our input image to a floating point data type and then |
| 15 | # compute the Harris corner matrix |
| 16 | gray = np.float32(img) |
| 17 | H = cv2.cornerHarris(gray, self.blockSize, self.apertureSize, self.k) |
| 18 | |
| 19 | # for every (x, y)-coordinate where the Harris value is above the |
| 20 | # threshold, create a keypoint (the Harris detector returns |
| 21 | # keypoint size a 3-pixel radius) |
| 22 | kps = np.argwhere(H > self.T * H.max()) |
| 23 | kps = [cv2.KeyPoint(pt[1], pt[0], 3) for pt in kps] |
| 24 | |
| 25 | # return the Harris keypoints |
| 26 | return kps |
nothing calls this directly
no outgoing calls
no test coverage detected