Forum

Author Topic: Import CSV file - Camera orientation data is lost  (Read 295 times)

BobvdMeij

  • Full Member
  • ***
  • Posts: 155
    • View Profile
Import CSV file - Camera orientation data is lost
« on: March 01, 2019, 01:59:43 PM »
Dear all,

We are dealing with an issue that results in the columns with camera orientation being lost upon importing a new CSV file containing adjusted camera position and accuracy data.

In short this is what we do:
- Import camera's+EXIF in Photoscan including position (lon, lat, GPSheight) accuracy (for lon, lat, GPSheight) and orientation (yaw,pitch,roll) information;
- Using external software we transform the original image position data stored in the EXIF/metadata to a local coordinate system (easting, northing, altitude)
- From the latter results a CSV file with 7 colums (ID, easting, northing, altitude, easting accuracy, northing accuracy, altitude accuracy)
- We then import the resultant CSV into Photoscan

As the camera-IDs in the CSV match with the Camera-IDs already present in Agisoft the imported data does correctly overwrite Long/Lat/GPSheight columns in the Reference pane. The same goes for the column storing the camera accuracy information. However, the data in the yaw/pitch/roll columns that WAS still present prior to importing the CSV is lost when the import is complete. See the attached screendump for a clarification.

Question: How can we preserve the original camera orientation data for Yaw/Pitch/Roll when importing a CSV file? We've already unchecked the 'Rotation' box in the ImportCSV window, hoping it would leave the orientation data as it is, but it does get rid of the orientation nonetheless.

Thanks in advance!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 10167
    • View Profile
Re: Import CSV file - Camera orientation data is lost
« Reply #1 on: March 01, 2019, 03:22:52 PM »
Hello BobvdMeij,

When the information is imported from CSV file the data for the corresponding instance in the Reference pane is completely re-written. So it doesn't just update a few selected fields.

Maybe you can export complete information from the Reference pane, then perform XYZ modification and import the data back?
Best regards,
Alexey Pasumansky,
AgiSoft LLC

BobvdMeij

  • Full Member
  • ***
  • Posts: 155
    • View Profile
Re: Import CSV file - Camera orientation data is lost
« Reply #2 on: March 01, 2019, 05:43:35 PM »
Hello BobvdMeij,

When the information is imported from CSV file the data for the corresponding instance in the Reference pane is completely re-written. So it doesn't just update a few selected fields.

Maybe you can export complete information from the Reference pane, then perform XYZ modification and import the data back?

Dear Alexey,

Thanks for the swift reply.

We've already tried the method you suggested, but we stumpled on a couple of things that need to be taken account. First of all the image's EXIF Yaw information is expressed within a -180/+180 range, whereas Photoscan defines Yaw along a 360 degree compass. The same goes for the Pitch metadata, where a perfectly nadir orientation in the image's own EXIF data states -90 degrees whereas Photoscan considers this as 0 degrees. Both these issues don't have to be a problem as these can be compensated for with simple algebra by adding 360 to the EXIF's Yaw value in case this is negative (<0) and subtracting 90 from the EXIF's Pitch.

The thing that struck us, however, is that something fishy goes on when the camera's Pitch angle is off-nadir facing slightly backwards (probably due to a sudden gust of wind). We've one instance where the EXIF metadata for that particular images reads a Pitch angle of -91.8 degrees, equaling a value of -1.8 degrees in Photoscan's referencing pane. In these instances, however, the addition/subtraction procedures described above are no longer applicable. See the attached screenshot. Even more interesting is that we've now found out that for these instances, when we add the EXIF's Roll value to the EXIF's Yaw value we are getting pretty close to the seemingly strange value that Photoscan procedures.

What's going on here?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 10167
    • View Profile
Re: Import CSV file - Camera orientation data is lost
« Reply #3 on: March 04, 2019, 12:15:05 PM »
Hello BobvdMeij,

By default Metashape/PhotoScan considers that (0, 0, 0) for yaw, pitch, roll defines the following case: aircraft is heading to the North, while the camera is mounted beneath it and is pointing perfectly vertically down. The vector on the image that goes from bottom to top of the image corresponds to the aircraft flight direction and the 2D image vector from left to right corresponding to the vector that goes from left wing to the right wing.
However, according to the screenshots you get proper pitch values on meta information input (that corresponds to the description provided above)?

If the nadir camera orientation in your case means 90 pitch, than you can input the corresponding offset in the GPS/INS offset tab of the camera calibration dialog, thus avoiding orientation angle correction.
Negative yaw values shouldn't be a problem, or could be corrected as 360 - abs(value) for the negative values.
Best regards,
Alexey Pasumansky,
AgiSoft LLC

andysfd

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Import CSV file - Camera orientation data is lost
« Reply #4 on: May 03, 2019, 05:23:14 PM »
Hi, we just bought Agisoft and are really happy, but:
Isn't there any possibility to keep the Orientation paramters? should not be that hard to implement...