Skip to content

an error in xfeat+lg_torch_hub.ipynb #106

@HumanDr

Description

@HumanDr

When I run xfeat+lg_torch_hub.ipynb ,The output of mkpts_0 and mkpts_1 are both 0.

These are the error messages:
error Traceback (most recent call last)
Cell In[19], line 19
16 print(mkpts_1.shape)
17 print(len(mkpts_1))
---> 19 canvas = warp_corners_and_draw_matches(mkpts_0, mkpts_1, im1, im2)
20 plt.figure(figsize=(12,12))
21 plt.imshow(canvas[..., ::-1]), plt.show()

Cell In[2], line 6
4 def warp_corners_and_draw_matches(ref_points, dst_points, img1, img2):
5 # Calculate the Homography matrix
----> 6 H, mask = cv2.findHomography(ref_points, dst_points, cv2.USAC_MAGSAC, 3.5, maxIters=1_000, confidence=0.999)
7 mask = mask.flatten()
9 print('inlier ratio: ', np.sum(mask)/len(mask))

error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\calib3d\src\usac\ransac_solvers.cpp:394: error: (-2:Unspecified error) in function 'auto __cdecl cv::usac::mergePoints::<lambda_ebfddccf6ce6f431289911da93cac0d6>::operator ()(class cv::Mat &,int) const'

Invalid dimension of point (expected: 'points.cols >= pt_dim'), where
'points.cols' is 0
must be greater than or equal to
'pt_dim' is 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions