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

Class DENSE

imutils/feature/dense.py:3–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1import cv2
2
3class DENSE:
4 def __init__(self, step=6, radius=.5):
5 self.step = step
6 self.radius = radius
7
8 def detect(self, img):
9 # initialize our list of keypoints
10 kps = []
11
12 # loop over the height and with of the image, taking a `step`
13 # in each direction
14 for x in range(0, img.shape[1], self.step):
15 for y in range(0, img.shape[0], self.step):
16 # create a keypoint and add it to the keypoints list
17 kps.append(cv2.KeyPoint(x, y, self.radius))
18
19 # return the dense keypoints
20 return kps
21
22 def setInt(self, var, val):
23 if var == "initXyStep":
24 self.step = val

Callers 1

FeatureDetector_createFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…