OpenDroneMap / ODM

A command line toolkit to generate maps, point clouds, 3D models and DEMs from drone, balloon or kite images. 📷
https://opendronemap.org
GNU Affero General Public License v3.0
4.7k stars 1.07k forks source link

PDAL: writers.las: Unable to convert scaled value (1.564621925e+25) to int32 for dimension 'Z' #798

Closed gmhuili closed 4 years ago

gmhuili commented 6 years ago

How did you install OpenDroneMap? (Docker, natively, ...)?

Docker.

What's your browser and operating system? (Copy/paste the output of https://www.whatismybrowser.com/)

Firefox 59 on Ubuntu Linux

What is the problem?

Building objmodel: Saving model... done. Whole texturing procedure took: 1427.13s [INFO] Running ODM Texturing Cell - Finished [INFO] Running ODM Georeferencing Cell [INFO] Running georeferencing with OpenSfM transformation matrix [DEBUG] running /code/build/bin/odm_georef -bundleFile /code/opensfm/bundle_r000.out -inputTransformFile /code/opensfm/geocoords_transformation.txt -inputFile /code/odm_texturing/odm_textured_model.obj -outputFile /code/odm_texturing/odm_textured_model_geo.obj -inputPointCloudFile /code/opensfm/depthmaps/merged.ply -outputPointCloudFile /code/odm_georeferencing/odm_georeferenced_model.ply -logFile /code/odm_georeferencing/odm_georeferencing_log.txt -outputTransformFile /code/odm_georeferencing/odm_georeferencing_transform.txt -georefFileOutputPath /code/odm_georeferencing/odm_georeferencing_model_geo.txt [DEBUG] running /code/SuperBuild/build/pdal/bin/pdal pipeline -i /code/odm_georeferencing/las.json --readers.ply.filename=/code/odm_georeferencing/odm_georeferenced_model.ply --writers.las.filename=/code/odm_georeferencing/odm_georeferenced_model.las PDAL: writers.las: Unable to convert scaled value (1.564621925e+25) to int32 for dimension 'Z' when writing LAS/LAZ file /code/odm_georeferencing/odm_georeferenced_model.las.

Traceback (most recent call last): File "/code/run.py", line 47, in plasm.execute(niter=1) File "/code/scripts/odm_georeferencing.py", line 142, in process tree.odm_georeferencing_las_json) File "/code/opendm/types.py", line 264, in convert_to_las '--writers.las.filename={f_out}'.format(**kwargs)) File "/code/opendm/system.py", line 34, in run raise Exception("Child returned {}".format(retcode)) Exception: Child returned 1

What should be the expected behavior? If this is a feature request, please describe in detail the changes you think should be made to the code, citing files and lines where changes should be made, if possible.

No this kind of issue.

How can we reproduce this? (What steps did you do to trigger the problem? What parameters are you using for processing? If possible please include a copy of your dataset uploaded on Google Drive or Dropbox. Be detailed)

It happens every time and could be caused by the pictures.

Build: docker build -t my_odm_image .

Run: docker run -it --rm -v $(pwd)/gcp_list.txt:/code/gcp_list.txt -v $(pwd)/images:/code/images -v $(pwd)/opensfm:/code/opensfm -v $(pwd)/odm_meshing:/code/odm_meshing -v $(pwd)/odm_georeferencing:/code/odm_georeferencing -v $(pwd)/odm_orthophoto:/code/odm_orthophoto -v $(pwd)/odm_texturing:/code/odm_texturing my_odm_image --mesh-size 100000

pierotofy commented 6 years ago

Related: http://community.opendronemap.org/t/copr-sample-dataset-failing/446/8

Can be reproduced by using this dataset, using gcp_list.txt for GCPs. https://github.com/OpenDroneMap/odm_data_copr

The problem is (probably) caused by odm_georef. The final transform (odm_georeferencing_transform.txt) is way out.

[ 0.00000000,   0.00000000, 0.00000000, 1000000000000000019884624838656.00000000 ]
[ 0.00000000,   0.00000000, 0.00000000, 1000000000000000019884624838656.00000000 ]
[ 0.00000008,   0.00000008, 1.00000000, 0.00000000 ]
[ 0.00000000,   0.00000000, 0.00000000, 1.00000000 ]

In turn this messes up odm_georeferencing.py, which calls pdal.

Help troubleshooting this is welcome.

adamsteer commented 6 years ago

Hi @pierotofy, @gmhuili - for:

PDAL: writers.las: Unable to convert scaled value (1.564621925e+25) to int32 for dimension 'Z'...

...PDAL is trying to stuff that value into int32 because that is the ASPRS spec for storing the dimension. You're correct about the matrix - if that transformation is correct, and assuming I'm reading it correctly, one workaround is adding an offset when writing out to LAS/LAZ - for example as a part of a PDAL pipeline:

{
"type": "writers.las",
"offset_x":"10000000000000000198846",
"offset_y": "10000000000000000198846",
...
...

}

...where offsets could be inferred as required? Unfortunately I don't know the ODM codebase, so can't test this idea - whip you up a pull request :/

gmhuili commented 6 years ago

Thanks @adamsteer! Will try it again once I get a chance.

adamsteer commented 6 years ago

Hi @gmhuili - without some work inside ODM, or changing the coordinates for your georeferencing, it'll likley still break right now.

Unfortunately I haven't seen where PDAL is invoked - https://github.com/OpenDroneMap/OpenDroneMap/blob/master/modules/odm_georef/src/Georef.cpp is where the last message output lives, but I can't yet see where it's writing pipeline is created or how to implement something like automagically creating an appropriate offset.

jtinguely commented 6 years ago

+1. I see this error quite often as well, I am running docker on windows 10 pro machine. I install ODM via Dockerhub.

Rob-Besaans commented 6 years ago

+1. Same issue as @jtinguely. Also windows 10 pro 32gb machine SSD. I installed docker from the WebODM Windows Commercial install package. I am testing this with the ODM NIR sample dataset however.

https://github.com/OpenDroneMap/odm_data_rv_nir

pierotofy commented 5 years ago

Hey @Rob-Besaans, @adamsteer, @gmhuili, are you still having this issue with the latest version of ODM? I'm having a hard time replicating this since we've released 0.4. Could you try to reprocess your datasets and let me know if the issue is still there? The opensfm pipeline has been updated with 0.4, so this could have fixed the problem.

hy9be commented 5 years ago

@pierotofy I can still reproduce this issue on 0.4RC1. Use the first 50 images of KITTI sequence 00 dataset: https://drive.google.com/file/d/0ByaBRAPfmgEqdXhJRmktQ2lsMEE/view

Rob-Besaans commented 5 years ago

Hi guys. Sorry I have a couple of business deadlines to meet over the next week or two. Please keep me in the loop. I'm happy to test further after my works finished.

Cheers

Robert Besaans Business Analyst

On Tue, 9 Oct 2018 11:02 am locus social inc notifications@github.com wrote:

@pierotofy https://github.com/pierotofy I can still reproduce this issue on 0.4RC1. Use the first 50 images of KITTI sequence 00 dataset: https://drive.google.com/file/d/0ByaBRAPfmgEqdXhJRmktQ2lsMEE/view

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OpenDroneMap/OpenDroneMap/issues/798#issuecomment-428043802, or mute the thread https://github.com/notifications/unsubscribe-auth/AQtWmqbF3Ofp6cpdg2Ed6hu3WiBYq0gSks5ujBG1gaJpZM4TBxjF .

skorasaurus commented 4 years ago

I've experienced this well on my data set from and odm docker image was built around (around 2019-08-05 or so.).

full logs and information is at https://community.opendronemap.org/t/unable-to-convert-scaled-value-1e-32-to-int32-pdal-with-grayscale-colorspace-images/2665

(the exact error was slightly different; in that it was dimension 'X'; not Z; it's viewable at https://gist.github.com/skorasaurus/1b194b8515a4f5a64255c2b2ca54fda5#file-output-L1578

UPDATE: (I've confirmed that in my instance, it was caused by images whose EXIF tags were not properly created)