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>