Add Roll, Pitch, Yaw to JPG

Started by pocarchini, November 06, 2023, 02:54:33 AM

Previous topic - Next topic

pocarchini

Hello.
Please Let me know How can I add  roll , pitch, yaw to my jpg
1. Read Roll, pitch, yaw data from csv file
2. open consol command window
3. system(exiftool.exe -GPSPitch=34.345 -GPSRoll=12.456 -GPSYaw=-12.789 DJI_20231101.jpg)  //simple
4. Error output
  GPSPitch is not defined
  GPSRoll is not defined
  GPSYaw is not defined

5. input exiftool.exe  -GPSLatitude=35.45634 -Pitch=34.345 -Roll=12.456 -Yaw=-12.789 DJI_20231101.jpg
  Success! , But 
  empty Roll Pitch Yaw meta data in the newly generated DJI_20231101.jpg => No Roll, Pitch, Yaw data 

6. Do I Need user configuration file? 
exiftool -config example.config

%Image::ExifTool::UserDefined = (
'Image::ExifTool::GPS::Main'=>{
    #Example 2. GPS:GPSPitch
    0xd000=> {
          Name => 'GPSPitch',
          Writable => 'rational64s',
    },
    #Example 3. GPS:GPSRoll
    0xd001=> {
          Name => 'GPSRoll',
          Writable => 'rational64s',
    },
  }
};


StarGeek

Quote from: pocarchini on November 06, 2023, 02:54:33 AM6. Do I Need user configuration file?

Yes.  Pitch, Roll, and Yaw are not standard tags in EXIF.  They are created by exiftool using a config file.

Important: Because they are non-standard, programs other than exiftool will not read them.  Even exiftool will treat them as Unknown (see the -u (-unknown) option) if the config file isn't used.

Quote3. system(exiftool.exe -GPSPitch=34.345 -GPSRoll=12.456 -GPSYaw=-12.789 DJI_20231101.jpg)  //simple
4. Error output
  GPSPitch is not defined
  GPSRoll is not defined
  GPSYaw is not defined

Whatever you are using here (Python I'm guessing?) isn't able to read the config file, which I'm assuming is your .ExifTool_config.  See the example.config file for the directories that exiftool is searching for the config file.

Quote5. input exiftool.exe  -GPSLatitude=35.45634 -Pitch=34.345 -Roll=12.456 -Yaw=-12.789 DJI_20231101.jpg
  Success! , But 
  empty Roll Pitch Yaw meta data in the newly generated DJI_20231101.jpg => No Roll, Pitch, Yaw data

See above about non-standard EXIF.  Instead, you should be writing to the DJI specific tags, assuming the program your using reads them.  Use the command in FAQ #3 to figure what tags are actually read. See the DJI Tags page.
"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

pocarchini

Thank you all
I found solution. 
1. Make myconfig.cfg file

%Image::ExifTool::UserDefined=(
'Image::ExifTool::Composite'=>{
  GimbalYawDegree=>{
    Require =>'Composite'
    ValueConv=>'int($val+0.5)',
    PrintConv=>'sprintf("%.1f",$val',
    PrintConvInv=> '$val',
    },
  GimbalPitchDegree=>{
    Require =>'Composite'
    ValueConv=>'int($val+0.5)',
    PrintConv=>'sprintf("%.1f",$val',
    PrintConvInv=> '$val',
    },
  GimbalRollDegree=>{
    Require =>'Composite'
    ValueConv=>'int($val+0.5)',
    PrintConv=>'sprintf("%.1f",$val',
    PrintConvInv=> '$val',
    },
  },
);

2. place it exiftool.exe folder 

3. open command window and input 
exiftool -config myconfig.cfg -GPSPitchDegree=34.345 -GPSRollDegree=12.456 -GPSYawDegree=-12.789 DJI_20231101.jpg

4. Success

StarGeek

Your config file isn't doing anything.  You are requiring the Composite tag, there isn't a tag called that, so it will always fail.

You have them in the Composite group but you didn't use Writable => 1,, so these tags are writing anything.

You name the tags GimbalYawDegree, GimbalPitchDegree, and GimbalRollDegree but use  GPSPitchDegree, GPSRollDegree, and GPSYawDegree in your example command.  If what you meant to show in the example command was the Gimbal tags, those were always writable. They are listed on the DJI tags page I referred to above.

Example, no config file needed
C:\>exiftool -P -overwrite_original -GimbalPitchDegree=34.345 -GimbalRollDegree=12.456 -GimbalYawDegree=-12.789 y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -G1 -a -s -Gimbal* y:\!temp\Test4.jpg
[XMP-drone-dji] GimbalPitchDegree               : 34.345
[XMP-drone-dji] GimbalRollDegree                : 12.456
[XMP-drone-dji] GimbalYawDegree                 : -12.789
"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