3
我想使用先前检测到的ORB特征位置来提取图像中的ORB描述符,使用先前确定的位置,从而绕过检测器。Python中的opencv2 ORB数据结构的深层副本
我似乎无法得到检测到的功能的深层拷贝,然后传回来生成新的描述符。
- 使用原始数据不变
f1
关键点来生成描述符的im_y
形象工程 - 运行检测两次,以确定重复显然不工作,而是一个黑客攻击的一位,我希望做一些处理在原始特征点上。
- 我的MacPorts通过OS X上运行的Python 2.7.6,2.4.8 opencv的,10.8.5
代码:
from matplotlib import pyplot as plt
import copy as cp
import cv2
im_x = cv2.imread('stinkbug1.png', 0)
im_y = cv2.imread('stinkbug2.png', 0)
orb = cv2.ORB()
# Keypoint detection in first image
f1 = orb.detect(im_x, None)
f1, d1 = orb.compute(im_x, f1)
# Make a copy of the orginal key points
f2 = cp.deepcopy(f1)
# Magic processing here
# Get descriptors from second y image using the detected points from the x image
f2, d2 = orb.compute(im_y, f2)
# f2 and d2 are now an empty list and a <NoneType>