Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#452 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
opencv, python
Lĩnh vực
computer-vision

Hướng nghiên cứu

Bắt đầu với trình tái hiện inline của alignImages và chạy nó với các phiên bản OpenCV-Python được liệt kê trên Windows 10 bằng các ảnh đầu vào giống hệt nhau. So sánh các keypoint ORB, các match, homography và thời gian chạy để xác định liệu hồi quy nằm trong package Python hay phần lõi OpenCV. Công việc được xem là hoàn tất khi hồi quy được giải thích và khắc phục, hoặc issue được chuyển đến dự án phù hợp kèm một trường hợp tái hiện tối thiểu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
5.4k
Fork
1k
Merge trung bình
22 giờ 17 phút
Pull request đã merge (30 ngày)
3

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của opencv/opencv-python

Tất cả issue của opencv/opencv-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.