Closed shortjonescipher closed 1 year ago
OK, but I can't help you If you don't share the images. have you tried with less Images?
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: @.***>
Can you please share the whole error trace?
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
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: @.***>
You should be able to log the matches graph with
stitch * --matches_graph_dot_file matches.txt
Could you please share the content?
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
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: @.***>
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
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:-
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
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
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
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
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
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
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: @.***>
You need to do it from within stitching-main
C:\Users\Christopher\AppData\Local\Programs\Python\Python38\stitching-main>python -m unittest
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
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
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
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
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
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
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: @.***>
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.
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
OK. now we are back to that TypeError: only integer scalar arrays can be converted to a scalar index.
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
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
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'
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
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
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
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: @.***>
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: @.***>
please also share the numpy version, I think it may be a numpy problem
import numpy
and then numpy.__version__
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: @.***>
try upgrade numpy using pip install numpy --upgrade
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
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
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
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'
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
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
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
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: @.***>
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: @.***>
Nice work, thanks for sharing the project! I'll leave this issue open, maybe someone with the same problem stumbles upon a sollution.
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
.
@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.
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'.