OpenStitching / stitching

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

miniflann.cpp:521: error: (-215:Assertion failed) (size_t)knn <= index_->size() in function 'cv::flann::runKnnSearch_' #242

Closed DuckersMcQuack closed 1 month ago

DuckersMcQuack commented 1 month ago

Trying to stitch a tiled map to one large image, but it fails on the first scan/task
There's 8800 ish tiles, each being 256x256.

File "C:\Users\DuckersMcQuack\Downloads\Stitching\stitching-main\venv\Scripts\stitch.exe__main__.py", line 7, in (3918).jpg 1 (3919).jpg 1 (3920).jpg 1 (3921).jpg 1 (3922).jpg 1 (3923).jpg 1 (3924).jpg 1 (3925).jpg 1 (3926 File "C:\Users\DuckersMcQuack\Downloads\Stitching\stitching-main\venv\Lib\site-packages\stitching\cli\stitch.py", line 328, in mainpg 1 (3937).jpg 1 (3938).jpg 1 (3939).jpg 1 (3940).jpg 1 (3941).jpg 1 (3942).jpg 1 (3943).jpg 1 (3944 panorama = stitcher.stitch(images, feature_masks).jpg 1 (3949).jpg 1 (3950).jpg 1 (3951).jpg 1 (3952).jpg 1 (3953 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^.jpg 1 (3958).jpg 1 (3959).jpg 1 (3960).jpg 1 (3961).jpg 1 (3962 File "C:\Users\DuckersMcQuack\Downloads\Stitching\stitching-main\venv\Lib\site-packages\stitching\stitcher.py", line 100, in stitchpg 1 (3973).jpg 1 (3974).jpg 1 (3975).jpg 1 (3976).jpg 1 (3977).jpg 1 (3978).jpg 1 (3979).jpg 1 (3980 matches = self.match_features(features)g 1 (3984).jpg 1 (3985).jpg 1 (3986).jpg 1 (3987).jpg 1 (3988).jpg 1 (3989 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^g 1 (3993).jpg 1 (3994).jpg 1 (3995).jpg 1 (3996).jpg 1 (3997).jpg 1 (3998 File "C:\Users\DuckersMcQuack\Downloads\Stitching\stitching-main\venv\Lib\site-packages\stitching\stitcher.py", line 144, in match_features return self.matcher.match_features(features) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\DuckersMcQuack\Downloads\Stitching\stitching-main\venv\Lib\site-packages\stitching\feature_matcher.py", line 25, in match_features pairwise_matches = self.matcher.apply2(features, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\flann\src\miniflann.cpp:521: error: (-215:Assertion failed) (sizet)knn <= index->size() in function 'cv::flann::runKnnSearch_'

lukasalexanderweber commented 1 month ago

Have you tried with less tiles (e.g. 3)?