features.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:finch 作者: chrisranderson 项目源码 文件源码
def orb_features(image, keypoints):
  if isinstance(keypoints, np.ndarray):
    # takes in x, y coordinates. size is the diameter of the descripted area
    keypoints = [cv2.KeyPoint(p[0], p[1], ORB_DESCRIPTOR_SIZE) for p in keypoints]

  orb = cv2.ORB_create()
  new_keypoints, descriptors = orb.compute(np.mean(image, axis=2).astype(np.uint8), keypoints)

  print('len(keypoints)', len(keypoints))
  print('len(new_keypoints)', len(new_keypoints))
  return new_keypoints, descriptors
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号