Errors when running example
Closed this issue · 1 comments
I'm having some issues running the example:
[max@goma OrthomosaicSLAM]$ python3 main.py -i images/campus_1 -o testout
[INFO] Importing Images...
[INFO] Importing Complete
[INFO] 29 Images have been loaded
(3200, 4800, 3)
13
(3724, 5272, 3)
20
(5277, 5543, 3)
25
(5920, 5658, 3)
25
(3200, 4800, 3)
32
(3836, 5248, 3)
39
(4229, 5421, 3)
1
Traceback (most recent call last):
File "/home/max/src/OrthomosaicSLAM/main.py", line 148, in <module>
tester.mixer()
File "/home/max/src/OrthomosaicSLAM/main.py", line 56, in mixer
self.temp_image = self.sticher(self.temp_image,self.images[x+1])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/max/src/OrthomosaicSLAM/main.py", line 103, in sticher
M, _ = cv2.findHomography(src_pts, dst_pts, cv2.RANSAC, 5.0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cv2.error: OpenCV(4.5.5) /io/opencv/modules/calib3d/src/fundam.cpp:385: error: (-28:Unknown error code -28) The input arrays should have at least 4 corresponding point sets to calculate Homography in function 'findHomography'
if I change MIN_MATCH_COUNT
to 4 it proceeds but then crashes again...
[max@goma OrthomosaicSLAM]$ python3 main.py -i images/campus_1 -o testout
[INFO] Importing Images...
[INFO] Importing Complete
[INFO] 29 Images have been loaded
(3200, 4800, 3)
13
(3724, 5272, 3)
20
(5277, 5543, 3)
25
(5920, 5658, 3)
25
(3200, 4800, 3)
32
(3836, 5248, 3)
39
(4229, 5421, 3)
1
Error
Traceback (most recent call last):
File "/home/max/src/OrthomosaicSLAM/main.py", line 148, in <module>
tester.mixer()
File "/home/max/src/OrthomosaicSLAM/main.py", line 56, in mixer
self.temp_image = self.sticher(self.temp_image,self.images[x+1])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/max/src/OrthomosaicSLAM/main.py", line 72, in sticher
print(self.image1.shape)
^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'shape'
Hi @maxogden, thank you for trying out the repo. There indeed seems to be a problem with the campus_1
dataset. The images were supposed to be from DSC05984.JPG
to DSC06014.JPG
, but a few images after DSC05993.JPG
seem to be missing until DSC05996.JPG
. (You can also visually notice the sudden decrease in overlap by scrolling through the pictures). When we try to stitch them, this sudden decrease in the overlap between DSC05993.JPG
and DSC05996.JPG
is why the code fails.
I will split the dataset into campus_1
and campus_2
as I no longer have the original images.
Here is campus_1
when run at scale_percent = 80
And here is campus_2
when run at scale_percent = 50
scale_percentage can be changed from line 33 in main.py