Drone: yaw (-180 to 180) to GpsImgDirection (0-360)

Started by vassam, September 17, 2021, 05:28:49 PM

Previous topic - Next topic

vassam

Hi! I am trying to replace the GpsImgDirection value with the value of the yaw tag but in the format of 0-360. The yaw values goes from -180 to + 180. So I want the positive values to be copied to the GpsImgDirection value and the negative ones firstly to be added 360 and then be copied.
I tried with the if function to do so but all I get is Warning: Not a floating point number.
Help!

StarGeek

"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

vassam

Yes I saw the thread but when I Tried to apply it for my case a warning pops up.
Warning: Must be a positive number for GPS:GPSImgDirection
I just want to tranform the yaw values of m y images to a 0-360 format (if thery are negative) and then replace the GSPImgDirection value to them.
I don't have a csv.

StarGeek

Oops, my mistake for not reading more carefully. Your use is much simpler, only requiring the math part of that command.

Try this
exiftool "-GpsImgDirection<${Yaw;$_=$_+($_<0?360:0)}" /path/to/files/
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

vassam


GoodKarma

Quote from: StarGeek on September 18, 2021, 09:58:55 AMOops, my mistake for not reading more carefully. Your use is much simpler, only requiring the math part of that command.

Try this
exiftool "-GpsImgDirection<${Yaw;$_=$_+($_<0?360:0)}" /path/to/files/

does this command only work on images with a negative YAW. I just come across this issue with some of my drone files

Phil Harvey

The command add 360 to the angle if the value is negative.

- 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 ($).

GoodKarma