OpenSfM
OpenSfM copied to clipboard
SIFT, SURF and ORB breaks on pictures without features
I runned bin/opensfm_run_all with multiple pictures, including these two. See: https://drive.google.com/drive/folders/1y35Noc-wHJwEIz3hROAqkSBVMGvYO-KU?usp=sharing
Instead of ignoring these pictures like the AKAZE and HAHOG the following error occures with SIFT, SURF and ORB:
ORB:
Traceback (most recent call last):
File "/source/OpenSfM/bin/opensfm_main.py", line 25, in <module>
commands.command_runner(
File "/source/OpenSfM/opensfm/commands/command_runner.py", line 37, in command_runner
command.run(data, args)
File "/source/OpenSfM/opensfm/commands/command.py", line 12, in run
self.run_impl(data, args)
File "/source/OpenSfM/opensfm/commands/detect_features.py", line 11, in run_impl
detect_features.run_dataset(dataset)
File "/source/OpenSfM/opensfm/actions/detect_features.py", line 15, in run_dataset
features_processing.run_features_processing(data, data.images(), False)
File "/source/OpenSfM/opensfm/features_processing.py", line 42, in run_features_processing
run_detection(process_queue)
File "/source/OpenSfM/opensfm/features_processing.py", line 155, in run_detection
detect(image, image_array, segmentation_array, instances_array, data, force)
File "/source/OpenSfM/opensfm/features_processing.py", line 227, in detect
p_unmasked, f_unmasked, c_unmasked = features.extract_features(
File "/source/OpenSfM/opensfm/features.py", line 551, in extract_features
xs = points[:, 0].round().astype(int)
IndexError: too many indices for array
SURF:
Traceback (most recent call last):
File "/source/OpenSfM/bin/opensfm_main.py", line 26, in <module>
commands.opensfm_commands, create_default_dataset_context, dataset_choices=["opensfm"]
File "/source/OpenSfM/opensfm/commands/command_runner.py", line 37, in command_runner
command.run(data, args)
File "/source/OpenSfM/opensfm/commands/command.py", line 12, in run
self.run_impl(data, args)
File "/source/OpenSfM/opensfm/commands/detect_features.py", line 11, in run_impl
detect_features.run_dataset(dataset)
File "/source/OpenSfM/opensfm/actions/detect_features.py", line 15, in run_dataset
features_processing.run_features_processing(data, data.images(), False)
File "/source/OpenSfM/opensfm/features_processing.py", line 42, in run_features_processing
run_detection(process_queue)
File "/source/OpenSfM/opensfm/features_processing.py", line 155, in run_detection
detect(image, image_array, segmentation_array, instances_array, data, force)
File "/source/OpenSfM/opensfm/features_processing.py", line 228, in detect
image_array, data.config, is_high_res_panorama(data, image, image_array)
File "/source/OpenSfM/opensfm/features.py", line 557, in extract_features
points, desc = extract_features_surf(image_gray, config, features_count)
File "/source/OpenSfM/opensfm/features.py", line 411, in extract_features_surf
desc = root_feature(desc)
File "/source/OpenSfM/opensfm/features.py", line 233, in root_feature
s = np.sum(desc, 1)
File "<_array_function_ internals>", line 6, in sum
File "/usr/local/lib/python3.7/dist-packages/numpy/core/fromnumeric.py", line 2260, in sum
initial=initial, where=where)
File "/usr/local/lib/python3.7/dist-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
numpy.AxisError: axis 1 is out of bounds for array of dimension 0
SIFT:
File "/source/OpenSfM/bin/opensfm_main.py", line 26, in <module>
commands.opensfm_commands, create_default_dataset_context, dataset_choices=["opensfm"]
File "/source/OpenSfM/opensfm/commands/command_runner.py", line 37, in command_runner
command.run(data, args)
File "/source/OpenSfM/opensfm/commands/command.py", line 12, in run
self.run_impl(data, args)
File "/source/OpenSfM/opensfm/commands/detect_features.py", line 11, in run_impl
detect_features.run_dataset(dataset)
File "/source/OpenSfM/opensfm/actions/detect_features.py", line 15, in run_dataset
features_processing.run_features_processing(data, data.images(), False)
File "/source/OpenSfM/opensfm/features_processing.py", line 42, in run_features_processing
run_detection(process_queue)
File "/source/OpenSfM/opensfm/features_processing.py", line 155, in run_detection
detect(image, image_array, segmentation_array, instances_array, data, force)
File "/source/OpenSfM/opensfm/features_processing.py", line 228, in detect
image_array, data.config, is_high_res_panorama(data, image, image_array)
File "/source/OpenSfM/opensfm/features.py", line 555, in extract_features
points, desc = extract_features_sift(image_gray, config, features_count)
File "/source/OpenSfM/opensfm/features.py", line 353, in extract_features_sift
desc = root_feature(desc)
File "/source/OpenSfM/opensfm/features.py", line 233, in root_feature
s = np.sum(desc, 1)
File "<_array_function_ internals>", line 6, in sum
File "/usr/local/lib/python3.7/dist-packages/numpy/core/fromnumeric.py", line 2260, in sum
initial=initial, where=where)
File "/usr/local/lib/python3.7/dist-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
numpy.AxisError: axis 1 is out of bounds for array of dimension 0
I will provide a Pull Request