| 1 | import cv2 |
| 2 | |
| 3 | class 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…