Main Menu

geotagging

Started by bugwriter, June 24, 2014, 10:00:20 AM

Previous topic - Next topic

bugwriter

hi, I have problems with geotagging my files.

This is the command and the result:
$ exiftool -geotag '/media/Data/micmac_projects/gps/dimanche-29-20130929.gpx' 20130929-132117-G12-6mm.CR2 -v2
Argument "-Geotime<DateTimeOriginal" is assumed
Loaded 149673 points from GPS track log file '/media/Data/micmac_projects/gps/dimanche-29-20130929.gpx'
  GPS track start: 2013:09:29 09:36:55 UTC
  GPS track end:   2013:09:28 15:00:55 UTC
Writing File:Geotag
======== 20130929-132117-G12-6mm.CR2
Setting new values from 20130929-132117-G12-6mm.CR2
  Geotime value:   2013:09:29 10:20:56 UTC (local timezone is +02:00)
Warning: Time is too far from nearest GPS fix in File:Geotime (ValueConvInv) - 20130929-132117-G12-6mm.CR2
Warning: No writable tags set from 20130929-132117-G12-6mm.CR2
Nothing changed in 20130929-132117-G12-6mm.CR2
    0 image files updated
    1 image files unchanged


Below is the exif. Obviously, the date/time original is well inside the track record. Record was made at every second.

What is the problem and how to fix it?

ExifTool Version Number         : 9.38
File Name                       : 20130929-132117-G12-6mm.CR2
Directory                       : .
File Size                       : 14 MB
File Modification Date/Time     : 2013:09:29 12:20:56+02:00
File Access Date/Time           : 2014:06:24 15:53:04+02:00
File Inode Change Date/Time     : 2014:06:24 13:08:24+02:00
File Permissions                : rw-rw-r--
File Type                       : CR2
MIME Type                       : image/x-canon-cr2
Exif Byte Order                 : Little-endian (Intel, II)
Image Width                     : 1600
Image Height                    : 1200
Bits Per Sample                 : 8 8 8
Compression                     : JPEG (old-style)
Image Description               :
Make                            : Canon
Camera Model Name               : Canon PowerShot G12
Preview Image Start             : 13798552
Orientation                     : Horizontal (normal)
Preview Image Length            : 937427
X Resolution                    : 180
Y Resolution                    : 180
Resolution Unit                 : inches
Modify Date                     : 2013:09:29 14:31:37
XMP Toolkit                     : XMP Core 4.4.0-Exiv2
Rating                          : 0
Exposure Time                   : 1/2000
F Number                        : 2.8
ISO                             : 200
Sensitivity Type                : Standard Output Sensitivity and Recommended Exposure Index
Exif Version                    : 0230
Date/Time Original              : 2013:09:29 12:20:56
Create Date                     : 2013:09:29 14:31:37
Components Configuration        : Y, Cb, Cr, -
Compressed Bits Per Pixel       : 3
Shutter Speed Value             : 1/2004
Aperture Value                  : 2.8
Max Aperture Value              : 2.8
Flash                           : Off, Did not fire
Focal Length                    : 6.1 mm
Macro Mode                      : Normal
Self Timer                      : Off
Quality                         : RAW
Canon Flash Mode                : Off
Continuous Drive                : Single
Focus Mode                      : Single
Record Mode                     : CR2
Canon Image Size                : Unknown (-1)
Easy Mode                       : Manual
Digital Zoom                    : None
Contrast                        : Normal
Saturation                      : Normal
Sharpness                       : 0
Camera ISO                      : 200
Metering Mode                   : Evaluative
Focus Range                     : Auto
AF Point                        : Manual AF point selection
Canon Exposure Mode             : Aperture-priority AE
Lens Type                       : Unknown (-1)
Max Focal Length                : 30.5 mm
Min Focal Length                : 6.1 mm
Focal Units                     : 1000/mm
Max Aperture                    : 2.8
Min Aperture                    : 8
Flash Activity                  : 0
Flash Bits                      : (none)
Focus Continuous                : Single
AE Setting                      : Normal AE
Image Stabilization             : On
Zoom Source Width               : 3648
Zoom Target Width               : 3648
Spot Metering Mode              : Center
Manual Flash Output             : n/a
SRAW Quality                    : n/a
Focal Type                      : Zoom
Focal Plane X Size              : 7.59 mm
Focal Plane Y Size              : 5.69 mm
Auto ISO                        : 100
Base ISO                        : 200
Measured EV                     : 14.12
Target Aperture                 : 2.8
Target Exposure Time            : 1/2004
Exposure Compensation           : 0
White Balance                   : Cloudy
Slow Shutter                    : Off
Shot Number In Continuous Burst : 0
Optical Zoom Code               : 0
Flash Guide Number              : 0
Flash Exposure Compensation     : 0
Auto Exposure Bracketing        : Off
AEB Bracket Value               : 0
Control Mode                    : Camera Local Control
Focus Distance Upper            : 65.53 m
Focus Distance Lower            : 0 m
Bulb Duration                   : 0
Camera Type                     : Compact
Auto Rotate                     : None
ND Filter                       : Off
Self Timer 2                    : 0
Flash Output                    : 0
Canon Image Type                : IMG:High definition image
Canon Firmware Version          : Firmware Version 1.00
File Number                     : 111-7819
Owner Name                      :
Rotation                        : 0
Camera Temperature              : 37 C
Canon Model ID                  : PowerShot G12
AF Area Mode                    : Single-point AF
Num AF Points                   : 9
Valid AF Points                 : 1
Canon Image Width               : 1600
Canon Image Height              : 1200
AF Image Width                  : 100
AF Image Height                 : 100
AF Area Widths                  : 10 0 0 0 0 0 0 0 0
AF Area Heights                 : 10 0 0 0 0 0 0 0 0
AF Area X Positions             : 0 0 0 0 0 0 0 0 0
AF Area Y Positions             : 0 0 0 0 0 0 0 0 0
AF Points In Focus              : 0
Primary AF Point                : 0
Thumbnail Image Valid Area      : 0 0 0 0
Date Stamp Mode                 : Off
My Color Mode                   : Off
Firmware Revision               : 1.00 rev 5.00
Categories                      : (none)
Intelligent Contrast            : Off
Image Unique ID                 : 62309a3cfae41e14ebeca496e79f8749
VRD Offset                      : 0
Sensor Width                    : 3744
Sensor Height                   : 2784
Sensor Left Border              : 72
Sensor Top Border               : 24
Sensor Right Border             : 3719
Sensor Bottom Border            : 2759
Black Mask Left Border          : 40
Black Mask Top Border           : 24
Black Mask Right Border         : 43
Black Mask Bottom Border        : 2759
Faces Detected                  : 0
Aspect Ratio                    : 4:3
Cropped Image Width             : 3648
Cropped Image Height            : 2736
Cropped Image Left              : 0
Cropped Image Top               : 0
WB RGGB Levels As Shot          : 1577 878 878 1782
Color Temp As Shot              : 6319
WB RGGB Levels Auto             : 1493 878 878 1870
Color Temp Auto                 : 5721
WB RGGB Levels Measured         : 1493 878 878 1870
Color Temp Measured             : 5721
WB RGGB Levels Daylight         : 1441 866 866 1945
Color Temp Daylight             : 5381
WB RGGB Levels Shade            : 1577 878 878 1782
Color Temp Shade                : 6319
WB RGGB Levels Cloudy           : 1577 878 878 1782
Color Temp Cloudy               : 6319
WB RGGB Levels Tungsten         : 1028 796 796 2500
Color Temp Tungsten             : 3615
WB RGGB Levels Fluorescent      : 1243 837 837 2198
Color Temp Fluorescent          : 4469
WB RGGB Levels Kelvin           : 1441 866 866 1945
Color Temp Kelvin               : 5381
WB RGGB Levels Flash            : 1842 883 883 1510
Color Temp Flash                : 8189
Peripheral Lighting             : Off
Chromatic Aberration Corr       : Off
Peripheral Lighting Value       : 0
Original Image Width            : 3648
Original Image Height           : 2736
User Comment                    :
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 3648
Exif Image Height               : 2736
Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100
Related Image Width             : 3648
Related Image Height            : 2736
Focal Plane X Resolution        : 12493.15068
Focal Plane Y Resolution        : 12493.15068
Focal Plane Resolution Unit     : inches
Sensing Method                  : One-chip color area
File Source                     : Digital Camera
Custom Rendered                 : Normal
Exposure Mode                   : Auto
Digital Zoom Ratio              : 1
Scene Capture Type              : Standard
Thumbnail Offset                : 11410
Thumbnail Length                : 4462
Photometric Interpretation      : RGB
Samples Per Pixel               : 3
Rows Per Strip                  : 342
Planar Configuration            : Chunky
Strip Offsets                   : 15872
Strip Byte Counts               : 12846968
Raw Image Segmentation          : 1 1848 1896
Aperture                        : 2.8
Drive Mode                      : Single-frame Shooting
Image Size                      : 3648x2736
Lens                            : 6.1 - 30.5 mm
Lens ID                         : Unknown 6-30mm
Preview Image                   : (Binary data 937427 bytes, use -b option to extract)
Scale Factor To 35 mm Equivalent: 4.7
Shooting Mode                   : Aperture-priority AE
Shutter Speed                   : 1/2000
Thumbnail Image                 : (Binary data 4462 bytes, use -b option to extract)
WB RGGB Levels                  : 1577 878 878 1782
Blue Balance                    : 2.029613
Circle Of Confusion             : 0.006 mm
Field Of View                   : 64.6 deg
Focal Length                    : 6.1 mm (35 mm equivalent: 28.5 mm)
Hyperfocal Distance             : 2.06 m
Lens                            : 6.1 - 30.5 mm (35 mm equivalent: 28.5 - 142.3 mm)
Light Value                     : 12.9
Red Balance                     : 1.796128
$


the

Phil Harvey

Odd.  I was confused because your track start is a later time than your track end.

Could you post or email the gpx file so I could take a look? (my email is philharvey66 at gmail.com)

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

Phil Harvey

I got your email, thanks.

Take a look at your GPX file.  The time jumps from

<time>2013-09-29T09:37:00.000Z</time>

to

<time>2013-09-29T12:07:26.400Z</time>

with no fixes in between.

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

bugwriter

tahnks for this.
shall I conclude that there must be only one track in the gpx file ?

and another issue:
after runing the geotagging I have in the exif file:
datetime original 134017
position : 36°52'33.17'' (which should be 36°52.552[8 or 9]) N 10°52'32.38'' (10°52.539[78])

but in the nmea file:
-> at 134017 the position is 3652.48N, 1052.4260, which is 250m from the one written in the exifs
-> the position written in the GPS does not exist in the NMEA file (1 record every second -> no interpolation needed)

Thanks again for helping. The folks around me have no clue about this problem :)

Phil Harvey

#4
Quote from: bugwriter on June 25, 2014, 09:16:46 AM
shall I conclude that there must be only one track in the gpx file ?

No.  Multiple tracks are fine.  Although processing a large GPX file may be slow.  You also sent your NMEA file, which contains a few quirks (missing fix status, etc) that cause ExifTool to not read it.  I will add a patch to ExifTool 9.66 for this, allowing you to read your NMEA directly, which will be much faster.

Quoteand another issue:
after runing the geotagging I have in the exif file:
datetime original 134017
position : 36°52'33.17'' (which should be 36°52.552[8 or 9]) N 10°52'32.38'' (10°52.539[78])

but in the nmea file:
-> at 134017 the position is 3652.48N, 1052.4260, which is 250m from the one written in the exifs
-> the position written in the GPS does not exist in the NMEA file (1 record every second -> no interpolation needed)

13:40:17 on what day?  Your GPX track has 3 different days with this time.  Also, be careful about the time zone.  DateTimeOriginal is in the local system time zone unless otherwise specified, but the GPX track is in UTC.

Also, I think your GPX conversion is suspect.  For example:

$GPRMC,120733.400,,3652.555962,N,01052.537357,E,0.635,,290913,,,A*0D
$GPGGA,120733.400,3652.555962,N,01052.537357,E,,8,,117.074,M,40.9,M,,*7E

vs.

<trkpt lat="36.875933" lon="10.875623" >
<ele>116.3</ele>
<time>2013-09-29T12:07:33.400Z</time>
<speed>0.3267</speed>
<name>trkpt-2013-09-29T12:07:33.400Z</name>
<fix>3d</fix>
<sat>8</sat>
</trkpt>

Note that the elevation is off by almost 1 metre.  I didn't check the coordinates though.

- Phil

Edit: Added note about difference between NMEA and GPX.
...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 ($).

bugwriter

I tried to fix thiis. I created a gpx which contains only the minute of the image. : from 13:40 to 13:40:59
exiv2 tells :Loaded 60 points from GPS track log file '/media/Data/micmac_projects/Kamech/Kamech2013/gps/test.gpx'
  GPS track start: 2013:09:29 13:40:00 UTC
  GPS track end:   2013:09:29 13:40:59 UTC
Writing File:Geotag
======== /media/Data/micmac_projects/Kamech/Kamech2013/images/images-bank/20130929-144038-G12-6mm.CR2
Setting new values from /media/Data/micmac_projects/Kamech/Kamech2013/images/images-bank/20130929-144038-G12-6mm.CR2
  Geotime value:   2013:09:29 11:40:17 UTC (local timezone is +02:00)
Warning: Time is too far before track in File:Geotime (ValueConvInv) - /media/Data/micmac_projects/Kamech/Kamech2013/images/images-bank/20130929-144038-G12-6mm.CR2
Warning: No writable tags set from /media/Data/micmac_projects/Kamech/Kamech2013/images/images-bank/20130929-144038-G12-6mm.CR2
Nothing changed in /media/Data/micmac_projects/Kamech/Kamech2013/images/images-bank/20130929-144038-G12-6mm.CR2
    0 image files updated
    1 image files unchanged


exif image is as follows. Image tag is : Date/Time Original              : 2013:09:29 13:40:17$ exiftool /media/Data/micmac_projects/Kamech/Kamech2013/images/images-bank/20130929-144038-G12-6mm.CR2
ExifTool Version Number         : 9.38
File Name                       : 20130929-144038-G12-6mm.CR2
Directory                       : /media/Data/micmac_projects/Kamech/Kamech2013/images/images-bank
File Size                       : 11 MB
File Modification Date/Time     : 2014:06:26 07:46:49+02:00
File Access Date/Time           : 2014:06:26 07:55:10+02:00
File Inode Change Date/Time     : 2014:06:26 07:46:49+02:00
File Permissions                : rw-rw-r--
File Type                       : CR2
MIME Type                       : image/x-canon-cr2
Exif Byte Order                 : Little-endian (Intel, II)
Image Width                     : 1600
Image Height                    : 1200
Bits Per Sample                 : 8 8 8
Compression                     : JPEG (old-style)
Image Description               :
Make                            : Canon
Camera Model Name               : Canon PowerShot G12
Preview Image Start             : 11499400
Orientation                     : Horizontal (normal)
Preview Image Length            : 521832
X Resolution                    : 180
Y Resolution                    : 180
Resolution Unit                 : inches
Modify Date                     : 2013:09:29 15:50:58
XMP Toolkit                     : XMP Core 4.4.0-Exiv2
Rating                          : 0
Exposure Time                   : 1/1000
F Number                        : 2.8
ISO                             : 200
Sensitivity Type                : Standard Output Sensitivity and Recommended Exposure Index
Exif Version                    : 0230
Date/Time Original              : 2013:09:29 13:40:17
Create Date                     : 2013:09:29 15:50:58
Components Configuration        : Y, Cb, Cr, -
Compressed Bits Per Pixel       : 3
Shutter Speed Value             : 1/1002
Aperture Value                  : 2.8
Max Aperture Value              : 2.8
Flash                           : Off, Did not fire
Focal Length                    : 6.1 mm
Macro Mode                      : Normal
Self Timer                      : Off
Quality                         : RAW
Canon Flash Mode                : Off
Continuous Drive                : Single
Focus Mode                      : Single
Record Mode                     : CR2
Canon Image Size                : Unknown (-1)
Easy Mode                       : Manual
Digital Zoom                    : None
Contrast                        : Normal
Saturation                      : Normal
Sharpness                       : 0
Camera ISO                      : 200
Metering Mode                   : Evaluative
Focus Range                     : Auto
AF Point                        : Manual AF point selection
Canon Exposure Mode             : Aperture-priority AE
Lens Type                       : Unknown (-1)
Max Focal Length                : 30.5 mm
Min Focal Length                : 6.1 mm
Focal Units                     : 1000/mm
Max Aperture                    : 2.8
Min Aperture                    : 8
Flash Activity                  : 0
Flash Bits                      : (none)
Focus Continuous                : Single
AE Setting                      : Normal AE
Image Stabilization             : On
Zoom Source Width               : 3648
Zoom Target Width               : 3648
Spot Metering Mode              : Center
Manual Flash Output             : n/a
SRAW Quality                    : n/a
Focal Type                      : Zoom
Focal Plane X Size              : 7.59 mm
Focal Plane Y Size              : 5.69 mm
Auto ISO                        : 100
Base ISO                        : 200
Measured EV                     : 12.91
Target Aperture                 : 2.8
Target Exposure Time            : 1/1002
Exposure Compensation           : 0
White Balance                   : Cloudy
Slow Shutter                    : Off
Shot Number In Continuous Burst : 0
Optical Zoom Code               : 0
Flash Guide Number              : 0
Flash Exposure Compensation     : 0
Auto Exposure Bracketing        : Off
AEB Bracket Value               : 0
Control Mode                    : Camera Local Control
Focus Distance Upper            : 4.38 m
Focus Distance Lower            : 0 m
Bulb Duration                   : 0
Camera Type                     : Compact
Auto Rotate                     : None
ND Filter                       : Off
Self Timer 2                    : 0
Flash Output                    : 0
Canon Image Type                : IMG:High definition image
Canon Firmware Version          : Firmware Version 1.00
File Number                     : 111-9375
Owner Name                      :
Rotation                        : 0
Camera Temperature              : 33 C
Canon Model ID                  : PowerShot G12
AF Area Mode                    : Single-point AF
Num AF Points                   : 9
Valid AF Points                 : 1
Canon Image Width               : 1600
Canon Image Height              : 1200
AF Image Width                  : 100
AF Image Height                 : 100
AF Area Widths                  : 10 0 0 0 0 0 0 0 0
AF Area Heights                 : 10 0 0 0 0 0 0 0 0
AF Area X Positions             : 0 0 0 0 0 0 0 0 0
AF Area Y Positions             : 0 0 0 0 0 0 0 0 0
AF Points In Focus              : 0
Primary AF Point                : 0
Thumbnail Image Valid Area      : 0 0 0 0
Date Stamp Mode                 : Off
My Color Mode                   : Off
Firmware Revision               : 1.00 rev 5.00
Categories                      : (none)
Intelligent Contrast            : Off
Image Unique ID                 : 1636c819fae41e14ebeca496e79f8749
VRD Offset                      : 0
Sensor Width                    : 3744
Sensor Height                   : 2784
Sensor Left Border              : 72
Sensor Top Border               : 24
Sensor Right Border             : 3719
Sensor Bottom Border            : 2759
Black Mask Left Border          : 40
Black Mask Top Border           : 24
Black Mask Right Border         : 43
Black Mask Bottom Border        : 2759
Faces Detected                  : 0
Aspect Ratio                    : 4:3
Cropped Image Width             : 3648
Cropped Image Height            : 2736
Cropped Image Left              : 0
Cropped Image Top               : 0
WB RGGB Levels As Shot          : 1583 875 875 1788
Color Temp As Shot              : 6314
WB RGGB Levels Auto             : 1493 878 878 1870
Color Temp Auto                 : 5721
WB RGGB Levels Measured         : 1493 878 878 1870
Color Temp Measured             : 5721
WB RGGB Levels Daylight         : 1438 870 870 1940
Color Temp Daylight             : 5387
WB RGGB Levels Shade            : 1583 875 875 1788
Color Temp Shade                : 6314
WB RGGB Levels Cloudy           : 1583 875 875 1788
Color Temp Cloudy               : 6314
WB RGGB Levels Tungsten         : 1062 814 814 2587
Color Temp Tungsten             : 3620
WB RGGB Levels Fluorescent      : 1251 842 842 2212
Color Temp Fluorescent          : 4469
WB RGGB Levels Kelvin           : 1438 870 870 1940
Color Temp Kelvin               : 5387
WB RGGB Levels Flash            : 1842 883 883 1510
Color Temp Flash                : 8189
Peripheral Lighting             : Off
Chromatic Aberration Corr       : Off
Peripheral Lighting Value       : 0
Original Image Width            : 3648
Original Image Height           : 2736
User Comment                    :
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 3648
Exif Image Height               : 2736
Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100
Related Image Width             : 3648
Related Image Height            : 2736
Focal Plane X Resolution        : 12493.15068
Focal Plane Y Resolution        : 12493.15068
Focal Plane Resolution Unit     : inches
Sensing Method                  : One-chip color area
File Source                     : Digital Camera
Custom Rendered                 : Normal
Exposure Mode                   : Auto
Digital Zoom Ratio              : 1
Scene Capture Type              : Standard
GPS Version ID                  : 2.3.0.0
GPS Latitude Ref                : North
GPS Longitude Ref               : East
GPS Altitude Ref                : Above Sea Level
GPS Time Stamp                  : 11:40:17
GPS Date Stamp                  : 2013:09:29
Thumbnail Offset                : 11628
Thumbnail Length                : 2439
Photometric Interpretation      : RGB
Samples Per Pixel               : 3
Rows Per Strip                  : 342
Planar Configuration            : Chunky
Strip Offsets                   : 14068
Strip Byte Counts               : 10549619
Raw Image Segmentation          : 1 1848 1896
Aperture                        : 2.8
Drive Mode                      : Single-frame Shooting
GPS Altitude                    : 113.7 m Above Sea Level
GPS Date/Time                   : 2013:09:29 11:40:17Z
GPS Latitude                    : 36 deg 52' 33.17" N
GPS Longitude                   : 10 deg 52' 32.38" E
GPS Position                    : 36 deg 52' 33.17" N, 10 deg 52' 32.38" E
Image Size                      : 3648x2736
Lens                            : 6.1 - 30.5 mm
Lens ID                         : Unknown 6-30mm
Preview Image                   : (Binary data 521832 bytes, use -b option to extract)
Scale Factor To 35 mm Equivalent: 4.7
Shooting Mode                   : Aperture-priority AE
Shutter Speed                   : 1/1000
Thumbnail Image                 : (Binary data 2439 bytes, use -b option to extract)
WB RGGB Levels                  : 1583 875 875 1788
Blue Balance                    : 2.043429
Circle Of Confusion             : 0.006 mm
Field Of View                   : 64.6 deg
Focal Length                    : 6.1 mm (35 mm equivalent: 28.5 mm)
Hyperfocal Distance             : 2.06 m
Lens                            : 6.1 - 30.5 mm (35 mm equivalent: 28.5 - 142.3 mm)
Light Value                     : 11.9
Red Balance                     : 1.809143
$


what is wrong there?
Please help. I am stuck

Phil Harvey

You should read troubleshooting point number 3 on the geotagging page.

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

bugwriter

thanks Phil,

I did exiftool -geotag test.gpx 20130929-144038-G12-16771.CR2  -geosync=+02:00:00

and it worked