I would like to use the previously detected ORB feature locations in an image to extract ORB descriptors in an other image, using the earlier ascertained locations, thus bypassing the detector.
I just can't seem to get a deepcopy of the detected features to process and later pass back to generate new descriptors.
- Using the original untouched
f1
keypoints to generate descriptors for theim_y
image works - Running the detector twice to ascertain a duplicate obviously does work, but is a bit of a hack and I would like to do some processing on the original feature points.
- I'm running Python 2.7.6, Opencv 2.4.8 via macports on OS X, 10.8.5
code:
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>