WebODM: numpy.linalg.linalg.LinAlgError: SVD did not converge

Hello,

I used a VIRB camera to get photos every 0.5 second to attempt to build a 3D model of a house…

files are here:

I had about 240 images, which kept triggering this error:

“numpy.linalg.linalg.LinAlgError: SVD did not converge”

no matter how many pictures from the data set where included.

I saw this error also explained here, but with no solution:


[INFO] Initializing OpenDroneMap app - Sat Dec 30 02:38:12 2017
[INFO] Running ODM Load Dataset Cell
[DEBUG] Loading dataset from: /var/www/data/43b9b781-f0c2-4da2-8f52-a116741b0dec/images
[DEBUG] /var/www/data/43b9b781-f0c2-4da2-8f52-a116741b0dec/images
[WARNING] Could not find ccd_width in file. Use --force-ccd or edit the sensor_data.json file to manually input ccd width
[DEBUG] Loaded VIRB0001-4.JPG | camera: garmin virb ultra 30 | dimensions: 4000 x 3000 | focal: 2.73 | ccd: None | lat: 40.5489360819 | lon: -75.9776550158 | alt: 142.470336
[WARNING] Could not find ccd_width in file. Use --force-ccd or edit the sensor_data.json file to manually input ccd width
[DEBUG] Loaded VIRB0001.JPG | camera: garmin virb ultra 30 | dimensions: 4000 x 3000 | focal: 2.73 | ccd: None | lat: 40.5489360819 | lon: -75.9776550158 | alt: 142.470336
[WARNING] Could not find ccd_width in file. Use --force-ccd or edit the sensor_data.json file to manually input ccd width
[DEBUG] Loaded VIRB0001-2.JPG | camera: garmin virb ultra 30 | dimensions: 4000 x 3000 | focal: 2.73 | ccd: None | lat: 40.5489360819 | lon: -75.9776550158 | alt: 142.470336
[WARNING] Could not find ccd_width in file. Use --force-ccd or edit the sensor_data.json file to manually input ccd width
[DEBUG] Loaded VIRB0001-3.JPG | camera: garmin virb ultra 30 | dimensions: 4000 x 3000 | focal: 2.73 | ccd: None | lat: 40.5489360819 | lon: -75.9776550158 | alt: 142.470336
[INFO] Found 4 usable images
[INFO] Running ODM Load Dataset Cell - Finished
[INFO] Running ODM OpenSfM Cell
[DEBUG] Altitude data detected, enabling it for GPS alignment
[DEBUG] running PYTHONPATH=/code/SuperBuild/install/lib/python2.7/dist-packages /code/SuperBuild/src/opensfm/bin/opensfm extract_metadata /var/www/data/43b9b781-f0c2-4da2-8f52-a116741b0dec/opensfm
2017-12-30 02:38:12,966 Extracting focal lengths for image VIRB0001-4.JPG
2017-12-30 02:38:13,050 Extracting focal lengths for image VIRB0001.JPG
2017-12-30 02:38:13,134 Extracting focal lengths for image VIRB0001-2.JPG
2017-12-30 02:38:13,219 Extracting focal lengths for image VIRB0001-3.JPG
[DEBUG] running PYTHONPATH=/code/SuperBuild/install/lib/python2.7/dist-packages /code/SuperBuild/src/opensfm/bin/opensfm detect_features /var/www/data/43b9b781-f0c2-4da2-8f52-a116741b0dec/opensfm
2017-12-30 02:38:13,967 Extracting ROOT_HAHOG features for image VIRB0001-4.JPG
2017-12-30 02:38:14,214 Extracting ROOT_HAHOG features for image VIRB0001.JPG
2017-12-30 02:38:14,476 Extracting ROOT_HAHOG features for image VIRB0001-2.JPG
2017-12-30 02:38:14,751 Extracting ROOT_HAHOG features for image VIRB0001-3.JPG
2017-12-30 02:38:15,851 Found 4945 points in 1.61691308022s
2017-12-30 02:38:16,091 Found 4966 points in 1.60258388519s
2017-12-30 02:38:16,390 Found 4963 points in 1.62758612633s
2017-12-30 02:38:16,622 Found 4971 points in 1.59048199654s
[DEBUG] running PYTHONPATH=/code/SuperBuild/install/lib/python2.7/dist-packages /code/SuperBuild/src/opensfm/bin/opensfm match_features /var/www/data/43b9b781-f0c2-4da2-8f52-a116741b0dec/opensfm
2017-12-30 02:38:17,425 Matching 6 image pairs
2017-12-30 02:38:17,754 Matching VIRB0001-4.JPG - 1 / 4
2017-12-30 02:38:18,003 Matching VIRB0001.JPG - 2 / 4
2017-12-30 02:38:18,250 Matching VIRB0001-3.JPG - 3 / 4
2017-12-30 02:38:18,517 Matching VIRB0001-2.JPG - 4 / 4
2017-12-30 02:38:18,812 VIRB0001-4.JPG - VIRB0001.JPG has 1963 candidate matches
2017-12-30 02:38:18,813 Robust matching time : 0.00153803825378s
2017-12-30 02:38:18,813 Full matching 1708 / 1963, time: 1.05967402458s
2017-12-30 02:38:19,305 VIRB0001-3.JPG - VIRB0001-4.JPG has 2351 candidate matches
2017-12-30 02:38:19,306 Robust matching time : 0.00154900550842s
2017-12-30 02:38:19,307 Full matching 2092 / 2351, time: 1.05590295792s
2017-12-30 02:38:19,604 VIRB0001-2.JPG - VIRB0001-3.JPG has 2944 candidate matches
2017-12-30 02:38:19,605 Robust matching time : 0.000793218612671s
2017-12-30 02:38:19,605 Full matching 2894 / 2944, time: 1.08821296692s
2017-12-30 02:38:20,349 VIRB0001-3.JPG - VIRB0001.JPG has 2756 candidate matches
2017-12-30 02:38:20,350 Robust matching time : 0.00078010559082s
2017-12-30 02:38:20,350 Full matching 2674 / 2756, time: 1.04383206367s
2017-12-30 02:38:20,670 VIRB0001-2.JPG - VIRB0001.JPG has 3462 candidate matches
2017-12-30 02:38:20,671 Robust matching time : 0.000649929046631s
2017-12-30 02:38:20,671 Full matching 3425 / 3462, time: 1.06571483612s
2017-12-30 02:38:21,624 VIRB0001-2.JPG - VIRB0001-4.JPG has 2049 candidate matches
2017-12-30 02:38:21,625 Robust matching time : 0.000977039337158s
2017-12-30 02:38:21,625 Full matching 1883 / 2049, time: 0.954139947891s
[DEBUG] running PYTHONPATH=/code/SuperBuild/install/lib/python2.7/dist-packages /code/SuperBuild/src/opensfm/bin/opensfm create_tracks /var/www/data/43b9b781-f0c2-4da2-8f52-a116741b0dec/opensfm
2017-12-30 02:38:22,203 reading features
2017-12-30 02:38:22,284 Merging features onto tracks
2017-12-30 02:38:22,396 Good tracks: 4722
[DEBUG] running PYTHONPATH=/code/SuperBuild/install/lib/python2.7/dist-packages /code/SuperBuild/src/opensfm/bin/opensfm reconstruct /var/www/data/43b9b781-f0c2-4da2-8f52-a116741b0dec/opensfm
2017-12-30 02:38:22,951 Starting incremental reconstruction
2017-12-30 02:38:24,517 Starting reconstruction with VIRB0001-4.JPG and VIRB0001.JPG
2017-12-30 02:38:24,883 Two-view reconstruction inliers: 1713 / 2023
2017-12-30 02:38:25,012 Triangulated: 930
2017-12-30 02:38:25,399 Ceres Solver Report: Iterations: 50, Initial cost: 1.552367e+02, Final cost: 3.184138e+01, Termination: NO_CONVERGENCE
2017-12-30 02:38:25,400 -------------------------------------------------------
2017-12-30 02:38:25,421 VIRB0001-2.JPG resection inliers: 743 / 860
2017-12-30 02:38:25,430 Adding VIRB0001-2.JPG to the reconstruction
2017-12-30 02:38:25,720 Ceres Solver Report: Iterations: 18, Initial cost: 7.195615e+01, Final cost: 5.474200e+01, Termination: CONVERGENCE
2017-12-30 02:38:25,721 Removed outliers: 0
/code/SuperBuild/src/opensfm/opensfm/align.py:84: RuntimeWarning: invalid value encountered in divide
A /= s
2017-12-30 02:38:25,732 -------------------------------------------------------
/code/SuperBuild/src/opensfm/opensfm/reconstruction.py:696: RuntimeWarning: invalid value encountered in less
inliers = np.linalg.norm(reprojected_bs - bs, axis=1) < threshold
2017-12-30 02:38:25,778 VIRB0001-3.JPG resection inliers: 0 / 1018
2017-12-30 02:38:25,779 Some images can not be added
2017-12-30 02:38:25,779 -------------------------------------------------------
2017-12-30 02:38:25,792 Ceres Solver Report: Iterations: -2, Initial cost: -1.000000e+00, Final cost: -1.000000e+00, Termination: FAILURE
Traceback (most recent call last):
File “/code/SuperBuild/src/opensfm/bin/opensfm”, line 34, in
command.run(args)
File “/code/SuperBuild/src/opensfm/opensfm/commands/reconstruct.py”, line 21, in run
report = reconstruction.incremental_reconstruction(data)
File “/code/SuperBuild/src/opensfm/opensfm/reconstruction.py”, line 1069, in incremental_reconstruction
data, graph, reconstruction, remaining_images, gcp)
File “/code/SuperBuild/src/opensfm/opensfm/reconstruction.py”, line 1031, in grow_reconstruction
align.align_reconstruction(reconstruction, gcp, data.config)
File “/code/SuperBuild/src/opensfm/opensfm/align.py”, line 14, in align_reconstruction
res = align_reconstruction_similarity(reconstruction, gcp, config)
File “/code/SuperBuild/src/opensfm/opensfm/align.py”, line 56, in align_reconstruction_similarity
return align_reconstruction_naive_similarity(reconstruction, gcp)
File “/code/SuperBuild/src/opensfm/opensfm/align.py”, line 80, in align_reconstruction_naive_similarity
T = tf.superimposition_matrix(X.T, Xp.T, scale=True)
File “/code/SuperBuild/src/opensfm/opensfm/transformations.py”, line 1041, in superimposition_matrix
scale=scale, usesvd=usesvd)
File “/code/SuperBuild/src/opensfm/opensfm/transformations.py”, line 954, in affine_matrix_from_points
u, s, vh = numpy.linalg.svd(numpy.dot(v1, v0.T))
File “/usr/lib/python2.7/dist-packages/numpy/linalg/linalg.py”, line 1359, in svd
u, s, vt = gufunc(a, signature=signature, extobj=extobj)
File “/usr/lib/python2.7/dist-packages/numpy/linalg/linalg.py”, line 99, in _raise_linalgerror_svd_nonconvergence
raise LinAlgError(“SVD did not converge”)
numpy.linalg.linalg.LinAlgError: SVD did not converge
Traceback (most recent call last):
File “/code/run.py”, line 47, in
plasm.execute(niter=1)
File “/code/scripts/opensfm.py”, line 122, in process
(context.pyopencv_path, context.opensfm_path, tree.opensfm))
File “/code/opendm/system.py”, line 34, in run
raise Exception(“Child returned {}”.format(retcode))
Exception: Child returned 1

Hey :raised_hand: @jdb532 thanks for sharing your data and reporting the problem. That error will appear when the input images are insufficient to generate a reconstruction (you need more images, from more angles).

We should probably improve the readability of the error message, so I opened https://github.com/OpenDroneMap/WebODM/issues/369