Hi folks, I am working on geotagging imagery from a combined UAS lidar/imagery sensor to process in Pix4D. Thanks to the great documentation and forum, I am quite close to my goals.
I modified the pix4d.config file to set up the xml tags from my output CSV of image locations/orientations/accuracy (example attached). The config file below allows me to write the XMP values as they are specified in the geoposition CSV (attached). This is working fine.
However, the pitch and roll information in the output does not follow the 0>360 degree formatting required and I'd like to do this 'conversion' as part of the process. For instance, the image DSC03979.jpg has associated pitch of -12.267579 degrees (should be 347.732421 degrees) and roll of -5.601032 degrees (should be 354.398968 degrees).
%Image::ExifTool::UserDefined = (
'Image::ExifTool::XMP::Main' => {
Camera => {
SubDirectory => {
TagTable => 'Image::ExifTool::UserDefined::Camera',
},
},
},
);
%Image::ExifTool::UserDefined::Camera = (
GROUPS => { 0 => 'XMP', 1 => 'XMP-Camera', 2 => 'Camera' },
NAMESPACE => { 'Camera' => 'http://pix4d.com/camera/1.0/' },
WRITABLE => 'string',
GPSLatitudeRef => { },
GPSLongitudeRef => { },
GPSAltitudeRef => { },
GPSXYAccuracy => { },
GPSZAccuracy => { },
Pitch => { },
Roll => { },
Yaw => { },
IMUPitchAccuracy => { },
IMURollAccuracy => { },
IMUYawAccuracy => { },
HorizCS => { },
VertCS => { },
); #end
This discussion I found was helpful but I am struggling on the implementation to my config to convert the values.
https://exiftool.org/forum/index.php?topic=9738.msg50838#msg50838
I feel like I'm close but there is something I am not getting, either with calling the variable from the Pitch column of the CSV or with the value conversion or with the writing (or all three). One example of what is not working for me. Have tried variations of this by trial and error with no promising results. I'd truly appreciate any insight!
Pitch => { Require => 'Pitch',
ValueConv => '$val + ($val < 0 ? 360 : 0)',
Writable => 'rational', },
Took me a bit, but I finally paid attention to the error message that popped up (no ValueConvInv, as we're converting the input, not the output).
Try this
%Image::ExifTool::UserDefined = (
'Image::ExifTool::XMP::Main' => {
Camera => {
SubDirectory => {
TagTable => 'Image::ExifTool::UserDefined::Camera',
},
},
},
);
%Image::ExifTool::UserDefined::Camera = (
GROUPS => { 0 => 'XMP', 1 => 'XMP-Camera', 2 => 'Camera' },
NAMESPACE => { 'Camera' => 'http://pix4d.com/camera/1.0/' },
WRITABLE => 'string',
GPSLatitudeRef => { },
GPSLongitudeRef => { },
GPSAltitudeRef => { },
GPSXYAccuracy => { },
GPSZAccuracy => { },
Pitch => {
ValueConvInv => '$val=$val + ($val < 0 ? 360 : 0); $val',
Writable => 'rational',
},
Roll => { },
Yaw => { },
IMUPitchAccuracy => { },
IMURollAccuracy => { },
IMUYawAccuracy => { },
HorizCS => { },
VertCS => { },
); #end
Example commands. Negative number processed, positive numbers passed through.
C:\>exiftool -config temp.config -P -overwrite_original -pitch=-12 y:\!temp\Test4.jpg
1 image files updated
C:\>exiftool -g1 -a -s -pitch y:\!temp\Test4.jpg
---- XMP-Camera ----
Pitch : 348
C:\>exiftool -config temp.config -P -overwrite_original -pitch=24 y:\!temp\Test4.jpg
1 image files updated
C:\>exiftool -g1 -a -s -pitch y:\!temp\Test4.jpg
---- XMP-Camera ----
Pitch : 24
Thank you!! That's perfect and greatly appreciated! I figured I wasn't far off :D