geojames / py_sfm_depth

A Python script for preforming refraction correction on Structure from Motion datasets.
MIT License
10 stars 6 forks source link

Error Running Script #3

Open lalafreguete opened 3 years ago

lalafreguete commented 3 years ago

Good morning. I am encountering a type of error ( image attached) while running the script which I haven't been able to fixed so far. When calling the footprints function at some moment of the iteration the variable inter_pt is not able to be defined and so I get the list index out of range. May I get some advices regarding this issue?

Thank you. image

geojames commented 3 years ago

My guess is that one of the camera positions or orientations might not be right. To isolate the specific camera, you could change line 179: if (idx +1) % 1 == 0: This will print out the camera number for each loop, that should isolate the camera that's causing the problem. Since it prints at the end of the loop.

If you want to upload your camera file I can take a look and see if there is anything that immediately jumps out at me.

lalafreguete commented 3 years ago

Apalachicola_SfM_Bathy_30_GCP_calibrated_external_camera_parameters_ypr.txt I am uploading here the camera file, however I believe it would help with I add some information about it. The angles values there in this file is a result of an attempt of converting the opk angles exported by Pix4D. I tried to converted it in Agisoft Metashape, but I am not confident in this method because the angles don't look right.

It seems the error shows up after the Camera '100_0010_0069': in the line 166, the inter_pt is empy. However, I didn't see much difference on the values from the previous cameras.

geojames commented 3 years ago

Agreed, the angles do not look right in the file. If the angles are not correct the software cannot intersect the camera rays with the ground surface to find the footprints - hence the error.

At the moment, I don't have support for OPK angles in the software. It's something that I'm looking into, but the conversations can get complicated.

lalafreguete commented 3 years ago

I appreciate your inputs, Dr. Dietrich. This is a barrier I have met through the processing. Surprisingly Pix4D is solving more points underwater than Metashape, but the caveat is that camera orientation is always exported as opk. I am concluding that a solution for the moment would to conduct the SfM processing in Metashape, even if gives less underwater area. Thanks again.