4

画像内の以前に検出された ORB 特徴位置を使用して、以前に確認された位置を使用して他の画像内の ORB 記述子を抽出し、検出器をバイパスしたいと考えています。

検出された機能のディープコピーを取得して処理し、後で新しい記述子を生成するために戻すことができないようです。

  1. 元の手つかずのキーポイントを使用して、画像f1の記述子を生成すると機能しますim_y
  2. 重複を確認するために検出器を 2 回実行することは明らかに機能しますが、これは少しハックであり、元の特徴点に対して何らかの処理を行いたいと考えています。
  3. OS X、10.8.5のmacports経由でPython 2.7.6、Opencv 2.4.8を実行しています

コード:

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>
4

1 に答える 1