Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A peculiar issue: Unable to reconstruct the orthophoto. #1815

Open
smallworld-network-wupeng opened this issue Dec 6, 2024 · 0 comments
Open

Comments

@smallworld-network-wupeng
Copy link

smallworld-network-wupeng commented Dec 6, 2024

Install ODM by Docker on ubuntu

A set of photos taken by DJI drones cannot be reconstructed in the orthophoto. The command is

 docker run -ti --rm -v /home/cheng-an-server/odm_images:/datasets opendronemap/odm:3.5.4 --project-path /datasets project --feature-quality high --skip-3dmodel --sfm-algorithm triangulation --fast-orthophoto --orthophoto-resolution 10

the error is:

Reading mesh file... /datasets/project/odm_texturing_25d/odm_textured_model_geo.obj
Found material0000
Loading odm_textured_model_geo_material0000_map_Kd.png
Found material0001
Loading odm_textured_model_geo_material0001_map_Kd.png
Found material0002
Loading odm_textured_model_geo_material0002_map_Kd.png
Found material0003
Loading odm_textured_model_geo_material0003_map_Kd.png
Mesh file read.

Boundary points:
Point 1: -4663.02 -10398.3
Point 2: -4663.02 10575.1
Point 3: 10370.4 10575.1
Point 4: 10370.4 -10398.3

Model bounds x : -4663.02 -> 10370.4
Model bounds y : -10398.3 -> 10575.1
Model area : 3.15302e+08m2
Error in OdmOrthoPhoto:
OpenCV(4.5.0) /code/SuperBuild/src/opencv/modules/core/src/alloc.cpp:73: error: (-4:Insufficient memory) Failed to allocate 126121443560 bytes in function 'OutOfMemoryError'


===== Dumping Info for Geeks (developers need this to fix bugs) =====
Child returned 1
Traceback (most recent call last):
  File "/code/stages/odm_app.py", line 82, in execute
    self.first_stage.run()
  File "/code/opendm/types.py", line 470, in run
    self.next_stage.run(outputs)
  File "/code/opendm/types.py", line 470, in run
    self.next_stage.run(outputs)
  File "/code/opendm/types.py", line 470, in run
    self.next_stage.run(outputs)
  [Previous line repeated 6 more times]
  File "/code/opendm/types.py", line 449, in run
    self.process(self.args, outputs)
  File "/code/stages/odm_orthophoto.py", line 107, in process
    system.run('"{odm_ortho_bin}" -inputFiles {models} '
  File "/code/opendm/system.py", line 112, in run
    raise SubprocessException("Child returned {}".format(retcode), retcode)
opendm.system.SubprocessException: Child returned 1

===== Done, human-readable information to follow... =====

[ERROR]   Uh oh! Processing stopped because of strange values in the reconstruction. This is often a sign that the input data has some issues or the software cannot deal with it. Have you followed best practices for data acquisition? See https://docs.opendronemap.org/flying/

But I try to this way by this command:

docker run -ti --rm -v /home/cheng-an-server/odm_images:/datasets opendronemap/odm:3.5.4 --project-path /datasets project --feature-quality high --skip-3dmodel --sfm-algorithm triangulation --fast-orthophoto --orthophoto-resolution 10 --gcp abc.gcp

First run it's report error:

[INFO]    Running dataset stage
[INFO]    Loading dataset from: /datasets/project/images
[INFO]    Loading 579 images
[INFO]    Wrote images database: /datasets/project/images.json
[INFO]    Found 579 usable images
[WARNING] GCP file does not exist: abc.gcp
[INFO]    Finished dataset stage
[INFO]    Running split stage
[INFO]    Normal dataset, will process all at once.
[INFO]    Finished split stage
[INFO]    Running merge stage
[INFO]    Normal dataset, nothing to merge.
[INFO]    Finished merge stage
[INFO]    Running opensfm stage
[INFO]    Maximum photo dimensions: 5280px
[INFO]    Photo dimensions for feature extraction: 2640px
[INFO]    Altitude data detected, enabling it for GPS alignment
Traceback (most recent call last):
  File "/code/run.py", line 65, in <module>
    retcode = app.execute()
  File "/code/stages/odm_app.py", line 118, in execute
    raise e
  File "/code/stages/odm_app.py", line 82, in execute
    self.first_stage.run()
  File "/code/opendm/types.py", line 470, in run
    self.next_stage.run(outputs)
  File "/code/opendm/types.py", line 470, in run
    self.next_stage.run(outputs)
  File "/code/opendm/types.py", line 470, in run
    self.next_stage.run(outputs)
  File "/code/opendm/types.py", line 449, in run
    self.process(self.args, outputs)
  File "/code/stages/run_opensfm.py", line 32, in process
    octx.setup(args, tree.dataset_raw, reconstruction=reconstruction, rerun=self.rerun())
  File "/code/opendm/osfm.py", line 319, in setup
    gcp_path = reconstruction.gcp.gcp_path
AttributeError: 'NoneType' object has no attribute 'gcp_path'`

But I try again , it's work ,Successfully reconstructed the orthophoto.

This orthophoto appears to be stitched perfectly, but the geographic coordinates are completely incorrect, placing it near the equator. The measured distances on the orthophoto are also inaccurate.

I suspect it might be due to the RTK system, as the orthophoto reconstruction worked perfectly with photos taken by other drones before. Below is the EXIF data of the photos:

`ExifTool Version Number         : 13.00
File Name                       : DJI_20241201121756_0003_V.jpeg
Directory                       : .
File Size                       : 11 MB
File Modification Date/Time     : 2024:12:06 18:44:06+08:00
File Access Date/Time           : 2024:12:06 18:48:47+08:00
File Inode Change Date/Time     : 2024:12:06 18:44:06+08:00
File Permissions                : -rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Little-endian (Intel, II)
Image Description               : default
Make                            : DJI
Camera Model Name               : M3D
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : 09.02.03.61
Modify Date                     : 2024:12:01 12:17:56
Y Cb Cr Positioning             : Co-sited
Exposure Time                   : 1/2000
F Number                        : 3.2
Exposure Program                : Program AE
ISO                             : 160
Sensitivity Type                : Recommended Exposure Index
Exif Version                    : 0230
Date/Time Original              : 2024:12:01 12:17:56
Create Date                     : 2024:12:01 12:17:56
Components Configuration        : Y, Cb, Cr, -
Shutter Speed Value             : 1/2000
Aperture Value                  : 3.2
Exposure Compensation           : 0
Max Aperture Value              : 2.8
Subject Distance                : 0 m
Metering Mode                   : Average
Light Source                    : Daylight
Flash                           : No Flash
Focal Length                    : 12.3 mm
Warning                         : [minor] Possibly incorrect maker notes offsets (fix by -452?)
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 5280
Exif Image Height               : 3956
Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100
File Source                     : Digital Camera
Scene Type                      : Directly photographed
Custom Rendered                 : Normal
Exposure Mode                   : Auto
White Balance                   : Auto
Digital Zoom Ratio              : 1
Focal Length In 35mm Format     : 24 mm
Scene Capture Type              : Standard
Gain Control                    : None
Contrast                        : Normal
Saturation                      : Normal
Sharpness                       : Normal
Device Setting Description      : (Binary data 4 bytes, use -b option to extract)
Serial Number                   : 1581F6QAD248L00GGQ90
Lens Info                       : 24mm f/2.8-11
Unique Camera Model             : DJI M3D
GPS Version ID                  : 2.3.0.0
GPS Latitude Ref                : North
GPS Longitude Ref               : East
GPS Altitude Ref                : Above Sea Level
GPS Status                      : Measurement Active
GPS Map Datum                   : WGS-84
XP Comment                      : 0.9.142
XP Keywords                     : single
Compression                     : JPEG
Thumbnail Offset                : 6800
Thumbnail Length                : 32420
About                           : DJI Meta Data
Format                          : image/jpg
Image Source                    : WideCamera
Gps Status                      : RTK
Altitude Type                   : RtkAlt
Absolute Altitude               : +220.827
Relative Altitude               : +99.542
Gimbal Roll Degree              : +180.00
Gimbal Yaw Degree               : -8.60
Gimbal Pitch Degree             : -90.00
Flight Roll Degree              : +1.20
Flight Yaw Degree               : +171.50
Flight Pitch Degree             : -18.90
Flight X Speed                  : -5.1
Flight Y Speed                  : 0.7
Flight Z Speed                  : 0.0
Cam Reverse                     : 0
Gimbal Reverse                  : 0
Sensor Temperature              : 38.0
Product Name                    : M3D
Self Data                       :
Rtk Flag                        : 50
Rtk Std Lon                     : 0.01113
Rtk Std Lat                     : 0.00916
Rtk Std Hgt                     : 0.02983
Rtk Diff Age                    : 1.20000
Surveying Mode                  : 1
Dewarp Flag                     : 0
Dewarp Data                     : 2022-06-08;3713.290000000000,3713.290000000000,7.020000000000,-8.720000000000,-0.112575240000,0.014874430000,-0.000085720000,0.000000100000,-0.027064110000
Calibrated Focal Length         : 3725.151611
Calibrated Optical Center X     : 2640.000000
Calibrated Optical Center Y     : 1978.000000
UTC At Exposure                 : 2024:12:01 04:18:15.011999
Shutter Type                    : Mechanical
Shutter Count                   : 13169
Camera Serial Number            : 493OM424AB0CJ8
Drone Model                     : M3D
Drone Serial Number             : 1581F6QAD248L00GGQ90
White Balance CCT               : 5141
Sensor FPS                      : 59.94
Version                         : 7.0
Has Settings                    : False
Has Crop                        : False
Already Applied                 : False
MPF Version                     : 0100
Number Of Images                : 2
MP Image Flags                  : Dependent child image
MP Image Format                 : JPEG
MP Image Type                   : Large Thumbnail (VGA equivalent)
MP Image Length                 : 881023
MP Image Start                  : 10518528
Dependent Image 1 Entry Number  : 0
Dependent Image 2 Entry Number  : 0
Image UID List                  : (Binary data 66 bytes, use -b option to extract)
Total Frames                    : 1
AE Debug Info                   : (Binary data 10240 bytes, use -b option to extract)
AE Histogram Info               : (Binary data 1024 bytes, use -b option to extract)
AE Local Histogram              : (Binary data 2048 bytes, use -b option to extract)
AE Live View Histogram Info     : (Binary data 2048 bytes, use -b option to extract)
AE Live View Local Histogram    : (Binary data 10000 bytes, use -b option to extract)
Awb Dbg Data V2                 : (Binary data 5120 bytes, use -b option to extract)
AF Debug Info                   : (Binary data 1024 bytes, use -b option to extract)
Histogram                       : (Binary data 1024 bytes, use -b option to extract)
ADJ Debug Info                  : (Binary data 4096 bytes, use -b option to extract)
Sensor ID                       : 493OM424AB0CJ8
Hyperlaps Debug Info            : (Binary data 8 bytes, use -b option to extract)
Scap Info                       : (Binary data 8192 bytes, use -b option to extract)
Sisr Info                       : (Binary data 4096 bytes, use -b option to extract)
JFIF Version                    : 1.02
Image Width                     : 5280
Image Height                    : 3956
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Aperture                        : 3.2
Image Size                      : 5280x3956
Megapixels                      : 20.9
Scale Factor To 35 mm Equivalent: 2.0
Shutter Speed                   : 1/2000
Thumbnail Image                 : (Binary data 32420 bytes, use -b option to extract)
GPS Altitude                    : 220.8 m Above Sea Level
GPS Latitude                    : 23 deg 14' 5.48" N
GPS Longitude                   : 113 deg 25' 14.06" E
Preview Image                   : (Binary data 881023 bytes, use -b option to extract)
Circle Of Confusion             : 0.015 mm
Field Of View                   : 73.7 deg
Focal Length                    : 12.3 mm (35 mm equivalent: 24.0 mm)
GPS Position                    : 23 deg 14' 5.48" N, 113 deg 25' 14.06" E
Hyperfocal Distance             : 3.07 m
Light Value                     : 13.6

This issue has been troubling me for a week, and I need everyone’s help.

This is a party of datasets:

By the way ,I can reconstructed the orthophoto by the webODM with same datasets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants