OpenStitching / stitching

A Python package for fast and robust Image Stitching
Apache License 2.0
1.99k stars 156 forks source link

module 'cv2.cv2' has no attribute 'detail_BundleAdjusterRay' #65

Closed CheskaAbarro closed 1 year ago

CheskaAbarro commented 1 year ago

Hey,

First of all, thank you for this wonderful source code. It wasreally helpful for me as a beginner.

I am having a problem with you Stitching Tutorial jupyter notebook. In this line

from stitching.image_handler import ImageHandler

img_handler = ImageHandler()
img_handler.set_img_names(weir_imgs)

medium_imgs = list(img_handler.resize_to_medium_resolution())
low_imgs = list(img_handler.resize_to_low_resolution(medium_imgs))
final_imgs = list(img_handler.resize_to_final_resolution())

I am havig this error:

AttributeError: module 'cv2.cv2' has no attribute 'detail_BundleAdjusterRay'

and I tried searching it but there is no solution that I found on this one. Can you help me solve this? Greatly appreciated.

lukasalexanderweber commented 1 year ago

It seems strange that the module is named cv2.cv2.

here is stated that you might need to pip install opencv-contrib-python.

How did you installed opencv?

CheskaAbarro commented 1 year ago

I had the following

opencv-python 4.7.0.72 opencv-contrib-python 4.7.0.72 stitching 0.4.0

I tried bunch of times to install different versions of opencv but the error still persist.

lukasalexanderweber commented 1 year ago

you could try only installing stitching. Pip will figure out the dependencies.

Do other parts of opencv work? Can you e.g. imread a simple image independent of the stitching package?

CheskaAbarro commented 1 year ago

I had a stitching 0.4.0 installed already and I tested, cv2.imread() is working.

The only line of code that I'm having a problem is with the

from stitching.image_handler import ImageHandler
lukasalexanderweber commented 1 year ago

sorry I don't really get it becaue detail_BundleAdjusterRay is not even called in the image handler

CheskaAbarro commented 1 year ago

Hello.

I had successfully executed your code. I downgraded the requirements into the following:

opencv-python = 3.4.2.16
opencv-contrib-python = 3.4.2.16
numpy = 1.21.6
stitching 0.2.0

Its a different error but somehow this solution works.

You have a wonderful work. Thanks again for sharing it.

lukasalexanderweber commented 1 year ago

thanks for your feedback! :)

nndei commented 11 months ago

Hello, I am having a similar problem on Mac.

Import "stitching.image_handler" could not be resolved Pylance(reportMissingImports)

I have tried uninstalling stitching, opencv-python, opencv-contrib-python, reinstalling only stitching… but nothing.

lukasalexanderweber commented 11 months ago

You need to use the new Tutorial Version

nndei commented 11 months ago

Thank you!