linrl3 / Image-Stitching-OpenCV

Simple image stitching algorithm based on SIFT, homography, KNN and Ransac in Python and OpenCV
MIT License
191 stars 43 forks source link

UnboundLocalError: local variable 'H' referenced before assignment #6

Open monkeycc opened 2 years ago

monkeycc commented 2 years ago
Traceback (most recent call last):
  File "d:\Image-Stitching-OpenCV\Image_Stitching.py", line 92, in <module>
    main(imageA,imageB)
  File "d:\Image-Stitching-OpenCV\Image_Stitching.py", line 74, in main
    final=Image_Stitching().blending(imageA,imageB)
  File "d:\Image-Stitching-OpenCV\Image_Stitching.py", line 51, in blending
    H = self.registration(img1,img2)
  File "d:\Image-Stitching-OpenCV\Image_Stitching.py", line 31, in registration
    return H
UnboundLocalError: local variable 'H' referenced before assignment
Narukara commented 10 months ago

应该是因为不满足上面的 len(good_points) > min_match,匹配上的点不够多