OpenStitching / stitching

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

TypeError: only integer scalar arrays can be converted to a scalar index #40

Closed shortjonescipher closed 1 year ago

shortjonescipher commented 1 year ago

I get this error from stitch * stitching frame1.jpg frame10.jpg frame11.jpg frame12.jpg frame13.jpg frame14.jpg frame15.jpg frame16.jpg frame17.jpg frame18.jpg frame19.jpg frame2.jpg frame20.jpg frame21.jpg frame22.jpg frame23.jpg frame24.jpg frame25.jpg frame26.jpg frame27.jpg frame28.jpg frame29.jpg frame3.jpg frame30.jpg frame31.jpg frame32.jpg frame33.jpg frame34.jpg frame35.jpg frame36.jpg frame37.jpg frame38.jpg frame39.jpg frame4.jpg frame40.jpg frame41.jpg frame42.jpg frame43.jpg frame44.jpg frame45.jpg frame46.jpg frame47.jpg frame48.jpg frame49.jpg frame5.jpg frame50.jpg frame6.jpg frame7.jpg frame8.jpg frame9.jpg into result.jpg on Windows 10 with Python Python 3.8.7 and cv2. version'4.5.1'.

lukasalexanderweber commented 1 year ago

OK, but I can't help you If you don't share the images. have you tried with less Images?

shortjonescipher commented 1 year ago

Thanks. Lukas

I also tried it on those boat images

stitch * stitching boat1.jpg boat2.jpg boat3.jpg boat4.jpg boat5.jpg boat6.jpg into result.jpg

which I got from https://github.com/opencv/opencv_extra/tree/4.x/testdata/stitching

and it failed in the same way.

I am doing stitch * from a folder which contains those images.

Regards

Chris Jones Sydney Australia chrisjones.id.au

On Sat, 10 Dec 2022 at 21:58, Lukas Weber @.***> wrote:

OK, but I can't help you If you don't share the images. have you tried with less Images?

— Reply to this email directly, view it on GitHub https://github.com/lukasalexanderweber/stitching/issues/40#issuecomment-1345238402, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZBOBAB2TKLZNESJE5OCM3WMRO6RANCNFSM6AAAAAAS2BTCKU . You are receiving this because you authored the thread.Message ID: @.***>

lukasalexanderweber commented 1 year ago

Can you please share the whole error trace?

shortjonescipher commented 1 year ago

Sorry, Lukas, I should have sent this before:-

stitch * stitching boat1.jpg boat2.jpg boat3.jpg boat4.jpg boat5.jpg boat6.jpg into result.jpg Traceback (most recent call last): File "c:\users\christopher\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\users\christopher\appdata\local\programs\python\python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\Scripts\stitch.exe__main__.py", line 7, in File "c:\users\christopher\appdata\local\programs\python\python38\lib\site-packages\stitching\cli\stitch.py", line 278, in main panorama = stitcher.stitch(img_names) File "c:\users\christopher\appdata\local\programs\python\python38\lib\site-packages\stitching\stitcher.py", line 92, in stitch imgs, features, matches = self.subset(imgs, features, matches) File "c:\users\christopher\appdata\local\programs\python\python38\lib\site-packages\stitching\stitcher.py", line 133, in subset names, sizes, imgs, features, matches = self.subsetter.subset( File "c:\users\christopher\appdata\local\programs\python\python38\lib\site-packages\stitching\subsetter.py", line 30, in subset img_names = Subsetter.subset_list(img_names, indices) File "c:\users\christopher\appdata\local\programs\python\python38\lib\site-packages\stitching\subsetter.py", line 59, in subset_list return [list_to_subset[i] for i in indices] File "c:\users\christopher\appdata\local\programs\python\python38\lib\site-packages\stitching\subsetter.py", line 59, in return [list_to_subset[i] for i in indices] TypeError: only integer scalar arrays can be converted to a scalar index

Chris

On Sun, 11 Dec 2022 at 00:58, Lukas Weber @.***> wrote:

Can you please share the whole error trace?

— Reply to this email directly, view it on GitHub https://github.com/lukasalexanderweber/stitching/issues/40#issuecomment-1345270537, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZBOBCDXQQN7VZ5EUMCAQ3WMSEBLANCNFSM6AAAAAAS2BTCKU . You are receiving this because you authored the thread.Message ID: @.***>

lukasalexanderweber commented 1 year ago

You should be able to log the matches graph with

stitch * --matches_graph_dot_file matches.txt

Could you please share the content?

shortjonescipher commented 1 year ago

stitch * --matches_graph_dot_file matches.txt stitching boat1.jpg boat2.jpg boat3.jpg boat4.jpg boat5.jpg boat6.jpg into result.jpg Traceback (most recent call last): File "c:\users\christopher\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\users\christopher\appdata\local\programs\python\python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\Scripts\stitch.exe__main__.py", line 7, in File "c:\users\christopher\appdata\local\programs\python\python38\lib\site-packages\stitching\cli\stitch.py", line 278, in main panorama = stitcher.stitch(img_names) File "c:\users\christopher\appdata\local\programs\python\python38\lib\site-packages\stitching\stitcher.py", line 92, in stitch imgs, features, matches = self.subset(imgs, features, matches) File "c:\users\christopher\appdata\local\programs\python\python38\lib\site-packages\stitching\stitcher.py", line 133, in subset names, sizes, imgs, features, matches = self.subsetter.subset( File "c:\users\christopher\appdata\local\programs\python\python38\lib\site-packages\stitching\subsetter.py", line 30, in subset img_names = Subsetter.subset_list(img_names, indices) File "c:\users\christopher\appdata\local\programs\python\python38\lib\site-packages\stitching\subsetter.py", line 59, in subset_list return [list_to_subset[i] for i in indices] File "c:\users\christopher\appdata\local\programs\python\python38\lib\site-packages\stitching\subsetter.py", line 59, in return [list_to_subset[i] for i in indices] TypeError: only integer scalar arrays can be converted to a scalar index

matches.txt:-

graph matches_graph{ "boat1.jpg" -- "boat2.jpg"[label="Nm=110, Ni=85, C=2.07317"]; "boat1.jpg" -- "boat3.jpg"[label="Nm=57, Ni=41, C=1.63347"]; "boat3.jpg" -- "boat4.jpg"[label="Nm=86, Ni=54, C=1.59763"]; "boat4.jpg" -- "boat5.jpg"[label="Nm=105, Ni=71, C=1.79747"]; "boat5.jpg" -- "boat6.jpg"[label="Nm=156, Ni=118, C=2.15328"]; }

On Sun, 11 Dec 2022 at 10:05, Lukas Weber @.***> wrote:

You should be able to log the matches graph with

stitch * --matches_graph_dot_file matches.txt

Could you please share the content?

— Reply to this email directly, view it on GitHub https://github.com/lukasalexanderweber/stitching/issues/40#issuecomment-1345404213, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZBOBBTFXL4VVJW56QZE3TWMUECZANCNFSM6AAAAAAS2BTCKU . You are receiving this because you authored the thread.Message ID: @.***>

lukasalexanderweber commented 1 year ago

Could you clone the repository and run python -m unittest and show me whats happening? I use the boat Images there and the Tests work fine on my maschine

shortjonescipher commented 1 year ago

Not sure that I'm doing this right. After cloning, I had downloaded stitching-main.zip which I extracted to stitching-main. Copied this to my Python38 folder to make sure I was using the right Python (also have Python 3.4.2 installed).

In a DOS window I then got:-

C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests>python -m unittest EEEEEE

ERROR: test_composition (unittest.loader.ModuleImportFailure)

Traceback (most recent call last): File "C:\Python34\lib\unittest\case.py", line 58, in testPartExecutor yield File "C:\Python34\lib\unittest\case.py", line 577, in run testMethod() File "C:\Python34\lib\unittest\loader.py", line 32, in testFailure raise exception ImportError: Failed to import test module: test_composition Traceback (most recent call last): File "C:\Python34\lib\unittest\loader.py", line 312, in _find_tests module = self._get_module_from_name(name) File "C:\Python34\lib\unittest\loader.py", line 290, in _get_module_from_name import(name) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_composition.py", line 7, in from .context import Stitcher SystemError: Parent module '' not loaded, cannot perform relative import

====================================================================== ERROR: test_matcher (unittest.loader.ModuleImportFailure)

Traceback (most recent call last): File "C:\Python34\lib\unittest\case.py", line 58, in testPartExecutor yield File "C:\Python34\lib\unittest\case.py", line 577, in run testMethod() File "C:\Python34\lib\unittest\loader.py", line 32, in testFailure raise exception ImportError: Failed to import test module: test_matcher Traceback (most recent call last): File "C:\Python34\lib\unittest\loader.py", line 312, in _find_tests module = self._get_module_from_name(name) File "C:\Python34\lib\unittest\loader.py", line 290, in _get_module_from_name import(name) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_matcher.py", line 5, in from .context import FeatureMatcher SystemError: Parent module '' not loaded, cannot perform relative import

====================================================================== ERROR: test_megapix_scaler (unittest.loader.ModuleImportFailure)

Traceback (most recent call last): File "C:\Python34\lib\unittest\case.py", line 58, in testPartExecutor yield File "C:\Python34\lib\unittest\case.py", line 577, in run testMethod() File "C:\Python34\lib\unittest\loader.py", line 32, in testFailure raise exception ImportError: Failed to import test module: test_megapix_scaler Traceback (most recent call last): File "C:\Python34\lib\unittest\loader.py", line 312, in _find_tests module = self._get_module_from_name(name) File "C:\Python34\lib\unittest\loader.py", line 290, in _get_module_from_name import(name) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_megapix_scaler.py", line 20 scale = scaler.get_scale_by_resolution(1_200_000) ^ SyntaxError: invalid syntax

====================================================================== ERROR: test_performance (unittest.loader.ModuleImportFailure)

Traceback (most recent call last): File "C:\Python34\lib\unittest\case.py", line 58, in testPartExecutor yield File "C:\Python34\lib\unittest\case.py", line 577, in run testMethod() File "C:\Python34\lib\unittest\loader.py", line 32, in testFailure raise exception ImportError: Failed to import test module: test_performance Traceback (most recent call last): File "C:\Python34\lib\unittest\loader.py", line 312, in _find_tests module = self._get_module_from_name(name) File "C:\Python34\lib\unittest\loader.py", line 290, in _get_module_from_name import(name) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_performance.py", line 41 print(f"Peak was {peak_memory / 10**6} MB") ^ SyntaxError: invalid syntax

====================================================================== ERROR: test_registration (unittest.loader.ModuleImportFailure)

Traceback (most recent call last): File "C:\Python34\lib\unittest\case.py", line 58, in testPartExecutor yield File "C:\Python34\lib\unittest\case.py", line 577, in run testMethod() File "C:\Python34\lib\unittest\loader.py", line 32, in testFailure raise exception ImportError: Failed to import test module: test_registration Traceback (most recent call last): File "C:\Python34\lib\unittest\loader.py", line 312, in _find_tests module = self._get_module_from_name(name) File "C:\Python34\lib\unittest\loader.py", line 290, in _get_module_from_name import(name) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_registration.py", line 7, in from .context import FeatureDetector, FeatureMatcher, Subsetter SystemError: Parent module '' not loaded, cannot perform relative import

====================================================================== ERROR: test_stitcher (unittest.loader.ModuleImportFailure)

Traceback (most recent call last): File "C:\Python34\lib\unittest\case.py", line 58, in testPartExecutor yield File "C:\Python34\lib\unittest\case.py", line 577, in run testMethod() File "C:\Python34\lib\unittest\loader.py", line 32, in testFailure raise exception ImportError: Failed to import test module: test_stitcher Traceback (most recent call last): File "C:\Python34\lib\unittest\loader.py", line 312, in _find_tests module = self._get_module_from_name(name) File "C:\Python34\lib\unittest\loader.py", line 290, in _get_module_from_name import(name) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_stitcher.py", line 7, in from .context import AffineStitcher, Stitcher SystemError: Parent module '' not loaded, cannot perform relative import


Ran 6 tests in 0.004s

FAILED (errors=6)

On Sun, 11 Dec 2022 at 18:45, Lukas Weber @.***> wrote:

Could you clone the repository and run python -m unittest and show me whats happening? I use the boat Images there and the Tests work fine on my maschine

— Reply to this email directly, view it on GitHub https://github.com/lukasalexanderweber/stitching/issues/40#issuecomment-1345481701, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZBOBAZNXVF3V7YYOYAXPLWMWBBRANCNFSM6AAAAAAS2BTCKU . You are receiving this because you authored the thread.Message ID: @.***>

lukasalexanderweber commented 1 year ago

You need to do it from within stitching-main

C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main>python -m unittest

shortjonescipher commented 1 year ago

C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main>python -m unittest EEEEEE

ERROR: tests.test_composition (unittest.loader.ModuleImportFailure)

Traceback (most recent call last): File "C:\Python34\lib\unittest\case.py", line 58, in testPartExecutor yield File "C:\Python34\lib\unittest\case.py", line 577, in run testMethod() File "C:\Python34\lib\unittest\loader.py", line 32, in testFailure raise exception ImportError: Failed to import test module: tests.test_composition Traceback (most recent call last): File "C:\Python34\lib\unittest\loader.py", line 312, in _find_tests module = self._get_module_from_name(name) File "C:\Python34\lib\unittest\loader.py", line 290, in _get_module_from_name import(name) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_composition.py", line 7, in from .context import Stitcher File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\context.py", line 6, in from stitching import AffineStitcher, Stitcher # noqa: F401, E402 File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching__init__.py", line 1, in from .stitcher import AffineStitcher, Stitcher # noqa: F401 File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 4, in from .camera_adjuster import CameraAdjuster File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\camera_adjuster.py", line 9, in class CameraAdjuster: File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\camera_adjuster.py", line 13, in CameraAdjuster CAMERA_ADJUSTER_CHOICES["ray"] = cv.detail_BundleAdjusterRay AttributeError: 'module' object has no attribute 'detail_BundleAdjusterRay'

====================================================================== ERROR: tests.test_matcher (unittest.loader.ModuleImportFailure)

Traceback (most recent call last): File "C:\Python34\lib\unittest\case.py", line 58, in testPartExecutor yield File "C:\Python34\lib\unittest\case.py", line 577, in run testMethod() File "C:\Python34\lib\unittest\loader.py", line 32, in testFailure raise exception ImportError: Failed to import test module: tests.test_matcher Traceback (most recent call last): File "C:\Python34\lib\unittest\loader.py", line 312, in _find_tests module = self._get_module_from_name(name) File "C:\Python34\lib\unittest\loader.py", line 290, in _get_module_from_name import(name) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_matcher.py", line 5, in from .context import FeatureMatcher File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\context.py", line 6, in from stitching import AffineStitcher, Stitcher # noqa: F401, E402 File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching__init__.py", line 1, in from .stitcher import AffineStitcher, Stitcher # noqa: F401 File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 4, in from .camera_adjuster import CameraAdjuster File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\camera_adjuster.py", line 9, in class CameraAdjuster: File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\camera_adjuster.py", line 13, in CameraAdjuster CAMERA_ADJUSTER_CHOICES["ray"] = cv.detail_BundleAdjusterRay AttributeError: 'module' object has no attribute 'detail_BundleAdjusterRay'

====================================================================== ERROR: tests.test_megapix_scaler (unittest.loader.ModuleImportFailure)

Traceback (most recent call last): File "C:\Python34\lib\unittest\case.py", line 58, in testPartExecutor yield File "C:\Python34\lib\unittest\case.py", line 577, in run testMethod() File "C:\Python34\lib\unittest\loader.py", line 32, in testFailure raise exception ImportError: Failed to import test module: tests.test_megapix_scaler Traceback (most recent call last): File "C:\Python34\lib\unittest\loader.py", line 312, in _find_tests module = self._get_module_from_name(name) File "C:\Python34\lib\unittest\loader.py", line 290, in _get_module_from_name import(name) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_megapix_scaler.py", line 20 scale = scaler.get_scale_by_resolution(1_200_000) ^ SyntaxError: invalid syntax

====================================================================== ERROR: tests.test_performance (unittest.loader.ModuleImportFailure)

Traceback (most recent call last): File "C:\Python34\lib\unittest\case.py", line 58, in testPartExecutor yield File "C:\Python34\lib\unittest\case.py", line 577, in run testMethod() File "C:\Python34\lib\unittest\loader.py", line 32, in testFailure raise exception ImportError: Failed to import test module: tests.test_performance Traceback (most recent call last): File "C:\Python34\lib\unittest\loader.py", line 312, in _find_tests module = self._get_module_from_name(name) File "C:\Python34\lib\unittest\loader.py", line 290, in _get_module_from_name import(name) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_performance.py", line 41 print(f"Peak was {peak_memory / 10**6} MB") ^ SyntaxError: invalid syntax

====================================================================== ERROR: tests.test_registration (unittest.loader.ModuleImportFailure)

Traceback (most recent call last): File "C:\Python34\lib\unittest\case.py", line 58, in testPartExecutor yield File "C:\Python34\lib\unittest\case.py", line 577, in run testMethod() File "C:\Python34\lib\unittest\loader.py", line 32, in testFailure raise exception ImportError: Failed to import test module: tests.test_registration Traceback (most recent call last): File "C:\Python34\lib\unittest\loader.py", line 312, in _find_tests module = self._get_module_from_name(name) File "C:\Python34\lib\unittest\loader.py", line 290, in _get_module_from_name import(name) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_registration.py", line 7, in from .context import FeatureDetector, FeatureMatcher, Subsetter File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\context.py", line 6, in from stitching import AffineStitcher, Stitcher # noqa: F401, E402 File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching__init__.py", line 1, in from .stitcher import AffineStitcher, Stitcher # noqa: F401 File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 4, in from .camera_adjuster import CameraAdjuster File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\camera_adjuster.py", line 9, in class CameraAdjuster: File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\camera_adjuster.py", line 13, in CameraAdjuster CAMERA_ADJUSTER_CHOICES["ray"] = cv.detail_BundleAdjusterRay AttributeError: 'module' object has no attribute 'detail_BundleAdjusterRay'

====================================================================== ERROR: tests.test_stitcher (unittest.loader.ModuleImportFailure)

Traceback (most recent call last): File "C:\Python34\lib\unittest\case.py", line 58, in testPartExecutor yield File "C:\Python34\lib\unittest\case.py", line 577, in run testMethod() File "C:\Python34\lib\unittest\loader.py", line 32, in testFailure raise exception ImportError: Failed to import test module: tests.test_stitcher Traceback (most recent call last): File "C:\Python34\lib\unittest\loader.py", line 312, in _find_tests module = self._get_module_from_name(name) File "C:\Python34\lib\unittest\loader.py", line 290, in _get_module_from_name import(name) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_stitcher.py", line 7, in from .context import AffineStitcher, Stitcher File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\context.py", line 6, in from stitching import AffineStitcher, Stitcher # noqa: F401, E402 File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching__init__.py", line 1, in from .stitcher import AffineStitcher, Stitcher # noqa: F401 File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 4, in from .camera_adjuster import CameraAdjuster File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\camera_adjuster.py", line 9, in class CameraAdjuster: File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\camera_adjuster.py", line 13, in CameraAdjuster CAMERA_ADJUSTER_CHOICES["ray"] = cv.detail_BundleAdjusterRay AttributeError: 'module' object has no attribute 'detail_BundleAdjusterRay'


Ran 6 tests in 0.003s

FAILED (errors=6)

On Mon, 12 Dec 2022 at 16:34, Lukas Weber @.***> wrote:

You need to do it from within stitching-main

C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main>python -m unittest

— Reply to this email directly, view it on GitHub https://github.com/lukasalexanderweber/stitching/issues/40#issuecomment-1345914093, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZBOBAHNVOPXXGTMSZH5MLWM22NJANCNFSM6AAAAAAS2BTCKU . You are receiving this because you authored the thread.Message ID: @.***>

lukasalexanderweber commented 1 year ago

You can see that the code is run based on your Python3.4 installation:

File "C:\Python34\lib\unittest\case.py", line 58, in testPartExecutor

I think that may be the cause.

lukasalexanderweber commented 1 year ago

You can also tell me your version of opencv. Type python to open the console and then import cv2 and then cv2.__version__. Mybe you have an older version where e.g. cv.detail_BundleAdjusterRay does not exist

shortjonescipher commented 1 year ago

OK. now we are back to that TypeError: only integer scalar arrays can be converted to a scalar index.

C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main>"C:\Users\Christopher\AppData\Local\Programs\Python\Python38\python.exe" -m unittest SURF not available SIFT not available EE.......s..EEssEE

ERROR: test_exposure_compensation (tests.test_composition.TestImageComposition)

Traceback (most recent call last): File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_composition.py", line 23, in test_exposure_compensation result = stitcher.stitch(["s1_bright.jpg", "s2.jpg"]) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 92, in stitch imgs, features, matches = self.subset(imgs, features, matches) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 133, in subset names, sizes, imgs, features, matches = self.subsetter.subset( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 30, in subset img_names = Subsetter.subset_list(img_names, indices) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in subset_list return [list_to_subset[i] for i in indices] File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in return [list_to_subset[i] for i in indices] TypeError: only integer scalar arrays can be converted to a scalar index

====================================================================== ERROR: test_timelapse (tests.test_composition.TestImageComposition)

Traceback (most recent call last): File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_composition.py", line 34, in testtimelapse = stitcher.stitch(["s1.jpg", "s2.jpg"]) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 92, in stitch imgs, features, matches = self.subset(imgs, features, matches) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 133, in subset names, sizes, imgs, features, matches = self.subsetter.subset( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 30, in subset img_names = Subsetter.subset_list(img_names, indices) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in subset_list return [list_to_subset[i] for i in indices] File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in return [list_to_subset[i] for i in indices] TypeError: only integer scalar arrays can be converted to a scalar index

====================================================================== ERROR: test_subsetting (tests.test_registration.TestImageRegistration)

Traceback (most recent call last): File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_registration.py", line 68, in test_subsetting indices_to_delete = subsetter.get_indices_to_delete(len(img_names), indices) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 77, in get_indices_to_delete return list(set(range(int(nr_elements))) - set(indices_to_keep)) TypeError: unhashable type: 'numpy.ndarray'

====================================================================== ERROR: test_stitcher_aquaduct (tests.test_stitcher.TestStitcher)

Traceback (most recent call last): File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_stitcher.py", line 18, in test_stitcher_aquaduct result = stitcher.stitch(["s1.jpg", "s2.jpg"]) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 92, in stitch imgs, features, matches = self.subset(imgs, features, matches) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 133, in subset names, sizes, imgs, features, matches = self.subsetter.subset( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 30, in subset img_names = Subsetter.subset_list(img_names, indices) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in subset_list return [list_to_subset[i] for i in indices] File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in return [list_to_subset[i] for i in indices] TypeError: only integer scalar arrays can be converted to a scalar index

====================================================================== ERROR: test_stitcher_boat_aquaduct_subset (tests.test_stitcher.TestStitcher)

Traceback (most recent call last): File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_stitcher.py", line 89, in test_stitcher_boat_aquaduct_subset result = stitcher.stitch( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 92, in stitch imgs, features, matches = self.subset(imgs, features, matches) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 133, in subset names, sizes, imgs, features, matches = self.subsetter.subset( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 30, in subset img_names = Subsetter.subset_list(img_names, indices) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in subset_list return [list_to_subset[i] for i in indices] File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in return [list_to_subset[i] for i in indices] TypeError: only integer scalar arrays can be converted to a scalar index

====================================================================== ERROR: test_stitcher_budapest (tests.test_stitcher.TestStitcher)

Traceback (most recent call last): File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_stitcher.py", line 115, in test_stitcher_budapest result = stitcher.stitch( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 92, in stitch imgs, features, matches = self.subset(imgs, features, matches) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 133, in subset names, sizes, imgs, features, matches = self.subsetter.subset( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 30, in subset img_names = Subsetter.subset_list(img_names, indices) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in subset_list return [list_to_subset[i] for i in indices] File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in return [list_to_subset[i] for i in indices] TypeError: only integer scalar arrays can be converted to a scalar index


Ran 18 tests in 4.074s

FAILED (errors=6, skipped=3)

On Mon, 12 Dec 2022 at 18:21, Lukas Weber @.***> wrote:

You can see that the code is run based on your Python3.4 installation:

File "C:\Python34\lib\unittest\case.py", line 58, in testPartExecutor

I think that may be the cause.

— Reply to this email directly, view it on GitHub https://github.com/lukasalexanderweber/stitching/issues/40#issuecomment-1346006137, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZBOBEXJ7KYH3TFHLELW23WM3HBBANCNFSM6AAAAAAS2BTCKU . You are receiving this because you authored the thread.Message ID: @.***>

shortjonescipher commented 1 year ago

Python 3.8.7 (tags/v3.8.7:6503f05, Dec 21 2020, 17:59:51) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import cv2 cv2.version '4.5.1'

On Mon, 12 Dec 2022 at 18:50, Lukas Weber @.***> wrote:

You can also tell me your version of opencv. Type python to open the console and then import cv2 and then cv2.version. Mybe you have an older version where e.g. cv.detail_BundleAdjusterRay does not exist

— Reply to this email directly, view it on GitHub https://github.com/lukasalexanderweber/stitching/issues/40#issuecomment-1346030760, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZBOBCJ54CXTYM6OUQ6RSLWM3KKXANCNFSM6AAAAAAS2BTCKU . You are receiving this because you authored the thread.Message ID: @.***>

lukasalexanderweber commented 1 year ago

please also share the numpy version, I think it may be a numpy problem

import numpy and then numpy.__version__

shortjonescipher commented 1 year ago

import numpy numpy.version '1.19.5'

On Mon, 12 Dec 2022 at 20:08, Lukas Weber @.***> wrote:

please also share the numpy version, I think it may be a numpy problem

import numpy and then numpy.version

— Reply to this email directly, view it on GitHub https://github.com/lukasalexanderweber/stitching/issues/40#issuecomment-1346129252, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZBOBBIOMSK5AW7ODA4DZLWM3TQ3ANCNFSM6AAAAAAS2BTCKU . You are receiving this because you authored the thread.Message ID: @.***>

lukasalexanderweber commented 1 year ago

try upgrade numpy using pip install numpy --upgrade

shortjonescipher commented 1 year ago

Did that, now Python 3.8.7 (tags/v3.8.7:6503f05, Dec 21 2020, 17:59:51) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import numpy numpy.version '1.23.5'

But still getting that error:-

Python 3.8.7 (tags/v3.8.7:6503f05, Dec 21 2020, 17:59:51) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import numpy numpy.version '1.23.5' ^Z

C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main>"C:\Users\Christopher\AppData\Local\Programs\Python\Python38\python.exe" -m unittest SURF not available SIFT not available EE.......s..EEssEE

ERROR: test_exposure_compensation (tests.test_composition.TestImageComposition)

Traceback (most recent call last): File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_composition.py", line 23, in test_exposure_compensation result = stitcher.stitch(["s1_bright.jpg", "s2.jpg"]) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 92, in stitch imgs, features, matches = self.subset(imgs, features, matches) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 133, in subset names, sizes, imgs, features, matches = self.subsetter.subset( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 30, in subset img_names = Subsetter.subset_list(img_names, indices) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in subset_list return [list_to_subset[i] for i in indices] File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in return [list_to_subset[i] for i in indices] TypeError: only integer scalar arrays can be converted to a scalar index

====================================================================== ERROR: test_timelapse (tests.test_composition.TestImageComposition)

Traceback (most recent call last): File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_composition.py", line 34, in testtimelapse = stitcher.stitch(["s1.jpg", "s2.jpg"]) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 92, in stitch imgs, features, matches = self.subset(imgs, features, matches) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 133, in subset names, sizes, imgs, features, matches = self.subsetter.subset( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 30, in subset img_names = Subsetter.subset_list(img_names, indices) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in subset_list return [list_to_subset[i] for i in indices] File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in return [list_to_subset[i] for i in indices] TypeError: only integer scalar arrays can be converted to a scalar index

====================================================================== ERROR: test_subsetting (tests.test_registration.TestImageRegistration)

Traceback (most recent call last): File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_registration.py", line 68, in test_subsetting indices_to_delete = subsetter.get_indices_to_delete(len(img_names), indices) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 77, in get_indices_to_delete return list(set(range(int(nr_elements))) - set(indices_to_keep)) TypeError: unhashable type: 'numpy.ndarray'

====================================================================== ERROR: test_stitcher_aquaduct (tests.test_stitcher.TestStitcher)

Traceback (most recent call last): File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_stitcher.py", line 18, in test_stitcher_aquaduct result = stitcher.stitch(["s1.jpg", "s2.jpg"]) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 92, in stitch imgs, features, matches = self.subset(imgs, features, matches) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 133, in subset names, sizes, imgs, features, matches = self.subsetter.subset( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 30, in subset img_names = Subsetter.subset_list(img_names, indices) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in subset_list return [list_to_subset[i] for i in indices] File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in return [list_to_subset[i] for i in indices] TypeError: only integer scalar arrays can be converted to a scalar index

====================================================================== ERROR: test_stitcher_boat_aquaduct_subset (tests.test_stitcher.TestStitcher)

Traceback (most recent call last): File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_stitcher.py", line 89, in test_stitcher_boat_aquaduct_subset result = stitcher.stitch( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 92, in stitch imgs, features, matches = self.subset(imgs, features, matches) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 133, in subset names, sizes, imgs, features, matches = self.subsetter.subset( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 30, in subset img_names = Subsetter.subset_list(img_names, indices) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in subset_list return [list_to_subset[i] for i in indices] File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in return [list_to_subset[i] for i in indices] TypeError: only integer scalar arrays can be converted to a scalar index

====================================================================== ERROR: test_stitcher_budapest (tests.test_stitcher.TestStitcher)

Traceback (most recent call last): File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_stitcher.py", line 115, in test_stitcher_budapest result = stitcher.stitch( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 92, in stitch imgs, features, matches = self.subset(imgs, features, matches) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 133, in subset names, sizes, imgs, features, matches = self.subsetter.subset( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 30, in subset img_names = Subsetter.subset_list(img_names, indices) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in subset_list return [list_to_subset[i] for i in indices] File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in return [list_to_subset[i] for i in indices] TypeError: only integer scalar arrays can be converted to a scalar index


Ran 18 tests in 3.705s

FAILED (errors=6, skipped=3)

On Mon, 12 Dec 2022 at 20:13, Lukas Weber @.***> wrote:

try upgrade numpy using pip install numpy --upgrade

— Reply to this email directly, view it on GitHub https://github.com/lukasalexanderweber/stitching/issues/40#issuecomment-1346136360, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZBOBDJRBADA3ZHT3BQH4TWM3UCVANCNFSM6AAAAAAS2BTCKU . You are receiving this because you authored the thread.Message ID: @.***>

shortjonescipher commented 1 year ago

Dear Lukas,

You have shown great patience in investigating this problem.

I had hoped to use your stitcher to align video from a 3D camera for stabilisation. I have now found that I can do this with the align_image_stack tool from Hugin, so will go with this and not await solution of this problem.

My project is described at chrisjones.id.au/stereoGIF. I was using your excellent largestinteriorrectangle library to crop the images obtained from PTGui.

Many thanks,

Chris

On Mon, 12 Dec 2022 at 22:25, Christopher Jones < @.***> wrote:

Did that, now Python 3.8.7 (tags/v3.8.7:6503f05, Dec 21 2020, 17:59:51) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import numpy numpy.version '1.23.5'

But still getting that error:-

Python 3.8.7 (tags/v3.8.7:6503f05, Dec 21 2020, 17:59:51) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import numpy numpy.version '1.23.5' ^Z

C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main>"C:\Users\Christopher\AppData\Local\Programs\Python\Python38\python.exe" -m unittest SURF not available SIFT not available EE.......s..EEssEE

ERROR: test_exposure_compensation (tests.test_composition.TestImageComposition)

Traceback (most recent call last): File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_composition.py", line 23, in test_exposure_compensation result = stitcher.stitch(["s1_bright.jpg", "s2.jpg"]) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 92, in stitch imgs, features, matches = self.subset(imgs, features, matches) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 133, in subset names, sizes, imgs, features, matches = self.subsetter.subset( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 30, in subset img_names = Subsetter.subset_list(img_names, indices) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in subset_list return [list_to_subset[i] for i in indices] File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in return [list_to_subset[i] for i in indices] TypeError: only integer scalar arrays can be converted to a scalar index

====================================================================== ERROR: test_timelapse (tests.test_composition.TestImageComposition)

Traceback (most recent call last): File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_composition.py", line 34, in testtimelapse = stitcher.stitch(["s1.jpg", "s2.jpg"]) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 92, in stitch imgs, features, matches = self.subset(imgs, features, matches) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 133, in subset names, sizes, imgs, features, matches = self.subsetter.subset( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 30, in subset img_names = Subsetter.subset_list(img_names, indices) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in subset_list return [list_to_subset[i] for i in indices] File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in return [list_to_subset[i] for i in indices] TypeError: only integer scalar arrays can be converted to a scalar index

====================================================================== ERROR: test_subsetting (tests.test_registration.TestImageRegistration)

Traceback (most recent call last): File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_registration.py", line 68, in test_subsetting indices_to_delete = subsetter.get_indices_to_delete(len(img_names), indices) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 77, in get_indices_to_delete return list(set(range(int(nr_elements))) - set(indices_to_keep)) TypeError: unhashable type: 'numpy.ndarray'

====================================================================== ERROR: test_stitcher_aquaduct (tests.test_stitcher.TestStitcher)

Traceback (most recent call last): File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_stitcher.py", line 18, in test_stitcher_aquaduct result = stitcher.stitch(["s1.jpg", "s2.jpg"]) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 92, in stitch imgs, features, matches = self.subset(imgs, features, matches) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 133, in subset names, sizes, imgs, features, matches = self.subsetter.subset( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 30, in subset img_names = Subsetter.subset_list(img_names, indices) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in subset_list return [list_to_subset[i] for i in indices] File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in return [list_to_subset[i] for i in indices] TypeError: only integer scalar arrays can be converted to a scalar index

====================================================================== ERROR: test_stitcher_boat_aquaduct_subset (tests.test_stitcher.TestStitcher)

Traceback (most recent call last): File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_stitcher.py", line 89, in test_stitcher_boat_aquaduct_subset result = stitcher.stitch( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 92, in stitch imgs, features, matches = self.subset(imgs, features, matches) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 133, in subset names, sizes, imgs, features, matches = self.subsetter.subset( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 30, in subset img_names = Subsetter.subset_list(img_names, indices) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in subset_list return [list_to_subset[i] for i in indices] File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in return [list_to_subset[i] for i in indices] TypeError: only integer scalar arrays can be converted to a scalar index

====================================================================== ERROR: test_stitcher_budapest (tests.test_stitcher.TestStitcher)

Traceback (most recent call last): File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\tests\test_stitcher.py", line 115, in test_stitcher_budapest result = stitcher.stitch( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 92, in stitch imgs, features, matches = self.subset(imgs, features, matches) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\stitcher.py", line 133, in subset names, sizes, imgs, features, matches = self.subsetter.subset( File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 30, in subset img_names = Subsetter.subset_list(img_names, indices) File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in subset_list return [list_to_subset[i] for i in indices] File "C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main\stitching\subsetter.py", line 59, in return [list_to_subset[i] for i in indices] TypeError: only integer scalar arrays can be converted to a scalar index


Ran 18 tests in 3.705s

FAILED (errors=6, skipped=3)

On Mon, 12 Dec 2022 at 20:13, Lukas Weber @.***> wrote:

try upgrade numpy using pip install numpy --upgrade

— Reply to this email directly, view it on GitHub https://github.com/lukasalexanderweber/stitching/issues/40#issuecomment-1346136360, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZBOBDJRBADA3ZHT3BQH4TWM3UCVANCNFSM6AAAAAAS2BTCKU . You are receiving this because you authored the thread.Message ID: @.***>

lukasalexanderweber commented 1 year ago

Nice work, thanks for sharing the project! I'll leave this issue open, maybe someone with the same problem stumbles upon a sollution.

SSRMori commented 1 year ago

I met the same problem. Maybe that is because cv.detail.leaveBiggestComponent returns a list like [[1], [2], [3]] rather than [1, 2, 3]. Flatten this indices may solve this problem.

I simply add the line

indices = list(np.array(indices).flatten())

in line 51, function get_indices_to_keep, subsetter.py, after getting indeices through cv.detail.leaveBiggestComponent.

lukasalexanderweber commented 1 year ago

@shortjonescipher @SSRMori or anybody who stumbles upon this issue: please share your images and system informations! I opened an issue in OpenCV and we need more Info.