0

I have two images that I want to compare. I am using orb.detect and orb.compute for this purpose.

My problem is that I want to feed certain key points and I am not able to find a way to do that.

I have tried things like:

originalx = [-24,-23,-21,20,35,35]
originaly = [37,-25,-41,14,5,-51]
originalori = [1,0.4,1,0.3,1.1,1]
kp1 = []
for i in range(6):
    cv2.KeyPoint.pt[0] = originalx[i]
    cv2.KeyPoint.pt[1] = originaly[i]
    cv2.KeyPoint.angle = originalori[i]
    cv2.Keypoint.append(kp1)

for both pictures to assign assign certain positions, angles, data_id etc. However, I get an error saying:

AttributeError: 'builtin_function_or_method' object has no attribute 'pt'

Does anyone then know how I could create my own keypoints rather than having orb.detect creating its own?

Thanks in advance!

  • If the attribute pt does not exist, maybe the attributes is _pt instead of pt? I found this in [the original documentation](http://docs.opencv.org/2.4/modules/features2d/doc/common_interfaces_of_feature_detectors.html) – marcoresk Oct 10 '16 at 09:45
  • 1
    Your loop is a bit iffy but you can pass the args to the `KeyPoint` constructor in your loop: `kp = cv2.KeyPoint(originalx[i], originaly[i], 1, angle= originalori[i]) kp1.append(kp)` but I don't know what would be a sensible value for `_size` (here I passed 1) – EdChum Oct 10 '16 at 12:08
  • That worked, EdChum; thanks for the help :-) – Sergio gdlhr Oct 14 '16 at 08:30

0 Answers0