question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NameError: name 'wgs84' is not defined in 1c-make-pix4d.py

See original GitHub issue

Hi again! I’ve been trying to use this project on a custom aerial dataset (crop_field). I tried running 1c-make-pix4d.py with

python3 1c-make-pix4d.py crop_field

and it yielded

Traceback (most recent call last):
  File "/Users/ImageAnalysis/scripts/1c-make-pix4d.py", line 26, in <module>
    pose.make_pix4d(image_dir, args.force_altitude, args.force_heading, args.yaw_from_groundtrack)
  File "/Users/ImageAnalysis/scripts/lib/pose.py", line 229, in make_pix4d
    wgs84.geo_inverse( cur[1], cur[2], next[1], next[2] )
NameError: name 'wgs84' is not defined

Am I missing a package or dependency? I’ve tried looking for a workaround but didn’t come across anything related

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
clolsonuscommented, Feb 3, 2021

Ok, there is an issue there, the message is coming from the aura-props code when overlaying one tree on top of another. Likely the whole “mount” subtree is lost which means the project won’t default to the proper camera mounting (straight down.) I don’t fully understand why I haven’t seen this before and why this case isn’t accounted for in the aura-props code. I need to dig deeper and try to understand and refresh my memory on that, but I probably don’t have time today. For now I woudl recommend adding the following snippet to your ImageAnalysis/config.json file right after camera make, model lines (and before width):

    "mount": {
        "pitch_deg": -90.0,
        "roll_deg": 0.0,
        "yaw_deg": 0.0
    },

The sequoia meta data for roll, pitch, and yaw is for the aircraft (and yaw is completely wrong all the time.) So you need to trigger the code --yaw-from-flighttrack and tell the system the mount offset of the camera when creating the pix4d.csv file.

0reactions
ArunLukeDsouzacommented, Feb 7, 2021

My bad I should’ve been more clear about it. I meant the DJI dataset yields similar errors to the Sensefly dataset when I deleted the configuration files that came with them keeping only the images, to see if I could reproduce your results from scratch

When I run

python3 1b-set-camera-config.py phantom-23-20190731

It yields

Camera: ../cameras/DJI_FC6310S.json
Unknown child type: mount <class 'props.PropertyNode'>

And when I run

python3 3a-matching.py phantom-23-20190731

It yields this massive error

Loading keypoint (pair) matches:
  0%|                                                   | 0/648 [00:00<?, ?it/s]phantom-23-20190731/ImageAnalysis/meta/DJI_1012.match:
  matches load error: <class 'FileNotFoundError'>: [Errno 2] No such file or directory: 'phantom-23-20190731/ImageAnalysis/meta/DJI_1012.match'
phantom-23-20190731/ImageAnalysis/meta/DJI_1013.match:
  matches load error: <class 'FileNotFoundError'>: [Errno 2] No such file or directory: 'phantom-23-20190731/ImageAnalysis/meta/DJI_1013.match'

Which goes on until the last image

phantom-23-20190731/ImageAnalysis/meta/DJI_1659.match:
  matches load error: <class 'FileNotFoundError'>: [Errno 2] No such file or directory: 'phantom-23-20190731/ImageAnalysis/meta/DJI_1659.match'
100%|██████████████████████████████████████| 648/648 [00:00<00:00, 19809.98it/s]
NED reference location: [43.92207759004631, -95.90702347586672, 0.0]
Initializing the SRTM interpolator
SRTM: loading DEM tiles
SRTM: parsing .hgt file: /var/tmp/N43W096.hgt.zip
SRTM: constructing LLA interpolator
SRTM: constructing NED area interpolator
Traceback (most recent call last):
  File "/Users/arun/Downloads/AERO2ASTRO/Project GIS/ImageAnalysis/scripts/3a-matching.py", line 102, in <module>
    surface.update_srtm_elevations(proj)
NameError: name 'surface' is not defined
Read more comments on GitHub >

github_iconTop Results From Across the Web

Converting EPSG:2263 to WGS84 using Python Pyproj
I'm trying to convert Projected bounds to WGS84 using Pyproj but getting strange results. The Projected Bounds are ...
Read more >
coordinates conversion with pyproj - python - Stack Overflow
When I reverse and enter these coordinates in google maps they give me correct locations. So this is working fine. Now I have...
Read more >
Getting Started - pyproj 3.4.1 documentation - GitHub Pages
Step 1: Inspect CRS definition to ensure proper area of use and axis order# · Step 2: Create Transformer to convert from CRS...
Read more >
Transform Coordinates between Different Reference Systems ...
Transform Coordinates between Different Reference Systems using Python Pyproj Library |EPSG | WGS84 Transform Coordinates between Different ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found