News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Write to EXIF from external sensor.

Started by Shane, April 13, 2020, 10:20:48 PM

Previous topic - Next topic

Shane

Hi.

I'm not sure if this can be answered here, but I thought I would try. I have used ExifTool to read/write metadata after an image has been taken. I am wanting to write EXIF data during image capture from an external sensor. More specifically I would like to write the yaw and pitch of the camera, based on readings from the external sensor that will be attached to the camera, as the photo is taken instead of having to add it later. Does anyone know if this has been done or is possible?

Thanks,
Shane

Phil Harvey

Hi Shane,

This is possible if you have control of the software that actually writes the image file.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Shane

Hi Phil,

Thanks for the quick response. In order to do that I would have to use a camera with an open API/SDK or something similar to Magic Lantern? I don't have a Cannon (Sony, Nikon) so Magic Lantern might be out for me as an option.


Phil Harvey

Yes.  This would be difficult.

It would be easier to log the external sensor data with timestamps and tag the images as they are downloaded from the camera.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Shane


Shane

Phil,

One follow-up question.

Let's say I sync the log with the timestamps for tagging the images like you suggested, as far as I can see there is no standard tags in EXIF to store the tilt/rotation of the camera. I ran across XMP tags camera.yaw and camera.pitch. Am I correct about no EXIF tags for storing the data?

Shane

Phil Harvey

Hi Shane,

This is a long-time deficiency in EXIF, although EXIF version 2.31 added the CameraElevationAngle tag, the other angle is still neglected (you can use the existing GPSImgDirection for the third angle).  The example ExifTool config file shows how to create user-defined EXIF GPSPitch and GPSRoll tags, but these are non-standard, and as such will only be readable by ExifTool.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Shane

So the CameraElevationAngle for pitch/tilt and GPSImgDirection for yaw/rotate? Otherwise use XMP tags?

Phil Harvey

Yup.

I was thinking that you meant camera roll when you mentioned rotation.  But if you meant yaw, then all is good.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Shane

Yes, I need Pitch and Yaw. I want to record the relative offsets of the yaw rotations starting at 0 and then every 30 degree taking a photo and recording that to EXIF and then tilt the camera up and 45 degrees and repeat yaw rotation then down 45 degree and repeat yaw rotations. So I want to record the yaw rotations, and the pitch of the camera at those rotations. I don't need true compass directions just the offsets starting from 0.

Phil Harvey

OK then.  GPSImgDirection will do for relative yaw.  You could just write some unknown value to GPSImgDirectionRef to indicate a non-standard reference direction.  For example:

exiftool -CameraElevationAngle=45 -GPSImgDirection=30 -GPSImgDirectionRef#=R FILE

(the '#' bypasses the print conversion, allowing you to write a nonstandard value.  Here I chose 'R' to indicate Relative.)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Shane

Hi Phil,

Thanks. That looks like it might work for what I need. I appreciate the help. I will give it a try.

Shane