File: helpers.py

package info (click to toggle)
python-imutils 0.5.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 7,652 kB
  • sloc: python: 1,178; makefile: 3
file content (11 lines) | stat: -rwxr-xr-x 327 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
# import the necesasry packages
import cv2

def corners_to_keypoints(corners):
    """function to take the corners from cv2.GoodFeaturesToTrack and return cv2.KeyPoints"""
    if corners is None:
        keypoints = []
    else:
        keypoints = [cv2.KeyPoint(kp[0][0], kp[0][1], 1) for kp in corners]

    return keypoints