MCPcopy Create free account
hub / github.com/PyImageSearch/imutils / detect

Method detect

imutils/feature/harris.py:13–26  ·  view source on GitHub ↗
(self, img)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected