Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

The Behavior of the cv2.ORB algorithm changes from version 4.1.2.30 to 4.2.0.32

オープン
#452 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
opencv, python

調査の方向性

inline alignImages 再現コードから始め、同一の入力画像を使って、記載されている OpenCV-Python の各バージョンを Windows 10 上で実行します。ORB のキーポイント、マッチ、ホモグラフィー、実行時間を比較し、リグレッションが Python パッケージにあるのか OpenCV コアにあるのかを特定します。リグレッションの原因が説明されて修正されるか、最小限の再現ケースを添えて適切なプロジェクトに issue が引き継がれれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Expected behaviour

I use the ORB image registration algorithm and it worked until 4.1.2.30. Same solution on same data!

Actual behaviour

From Version 4.1.2.32 to newest (4.5.1.48) it has a different (wrong) solution on the same data AND it needs about 3 times more time.

Steps to reproduce
def alignImages(im, imRef):
    MAX_FEATURES = 1000
    GOOD_MATCH_PERCENT = 0.5

    # Detect ORB features and compute descriptors.
    orb = cv2.ORB_create(MAX_FEATURES, scaleFactor=2, WTA_K=4, scoreType=cv2.ORB_HARRIS_SCORE, patchSize=61)

    keypoints1, descriptors1 = orb.detectAndCompute(im, None)
    keypoints2, descriptors2 = orb.detectAndCompute(imRef, None)
    #print('after kp2: ', time.time() - t)

    print('len keypoints:', len(keypoints1), ' ',len(keypoints2))

    # Match features.
    matcher = cv2.DescriptorMatcher_create(cv2.DESCRIPTOR_MATCHER_BRUTEFORCE_HAMMING)
    matches = matcher.match(descriptors1, descriptors2, None)

    #print('after matcher: ', time.time() - t)

    # Sort matches by score
    matches.sort(key=lambda x: x.distance, reverse=False)

    # Remove not so good matches
    numGoodMatches = int(len(matches) * GOOD_MATCH_PERCENT)
    matches = matches[:numGoodMatches]

    # Extract location of good matches
    points1 = np.zeros((len(matches), 2), dtype=np.float32)
    points2 = np.zeros((len(matches), 2), dtype=np.float32)

    for i, match in enumerate(matches):
        points1[i, :] = keypoints1[match.queryIdx].pt
        points2[i, :] = keypoints2[match.trainIdx].pt

    # Find homography
    h, mask = cv2.findHomography(points1, points2, cv2.RANSAC)
    return h

  • operating system: WIN 10 64-bit
Issue submission checklist

sorry, i don't know if it is a opencv-python issue or a opencv issue.

主要言語
Python
スター
5.4k
フォーク
1k
平均マージ
22時間 17分
マージ済み PR(30日)
3

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

opencv/opencv-python のほかの issue

opencv/opencv-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。