Borked westbound Garmin Virb image directions

I often use the JOSM Photogeotagging Plugin to check/correct sequences taken with my Garmin Virb elite.

Doing so I have noticed that the directions of all images taken while moving east (1-180°) are calculated correctly by the Virb, while all images taken while moving west (180-360°) are borked in some weird way that by the plugin is always shown as 90° left to the actual direction of travel.

HojrupBuen1
Travelling slightly SE

HojrupBuen2
Travelling slightly SW

Now I’d like to know how to compute the correct direction from this. Is it possible?

1 Like

In https://github.com/mapillary/mapillary_tools/tree/master/python there is a script which will write a direction based on your tracel direction. You can also tell it that the camera did not point forward and it will correct for that.

There is no tool to just adjust the direction - I don’t know if it is possible with exiftool.

If you would like to run the script and needs help, we have the thread https://forum.mapillary.com/t/running-the-python-scripts/130 for that.

What I would like to know is how to fix just the images where the direction is broken, based on the information that is obviously there.

What I think is happening is:
4294967295 Is the maximum number an unsigned integer can show. It cannot store negative numbers. Maybe the Virb records the compass heading as +/-180 from the zero degree mark (probably north).
As the plugin can’t handle a negative value, it wraps around, giving you your weird value.
If there’s a way to change the settings to make the heading absolute, rather than relative to north, it might fix it. I don’t have a Virb to advise further though.
A bit of maths could modify the exif files potentially, too. E.g. subtract 4294966935 (this is 4294967295 -360) and it will give you the correct heading.

It could possibly also be fixed in the plugin. If you have access to the code, or a similar setting is available.

@hjart, I have a couple Garmin elites. sometimes they just get the direction wrong. Others are in the side window of the car. I just go into the mapillary map after uploading them and change the sequence direction. Give me a holler if it would help for me to share an example with screen shots.

I’ve played a bit with exiftool now and found that the commandline

exiftool -GPSimgdirection -if '$GPSImgDirection > 360' *.JPG

will find the images on the Virb which has broken values.

Now I just need to figure out how to subtract 4294966935 from GPSImgDirection in that commandline and write it to the images.

For your info the following is what Exiftool reports on one imagefile from the Virb:
VirbImagedirection

Note that the problem is in the Virb image, not the JOSM plugin (which unlike i.e. the Mapillary website just happens to make some sense from the value).

Also note that my Virb is usually firmly mounted on my bicycle handlebar (when I’m not using it like an ordinary camera) and always pointing straight forward and that it doesn’t “just sometimes get the direction wrong”. It’s always when it’s pointing west.

Update:

I had tried to use decrement, but without any luck.

After reading http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,4462.0.html though, I realize that increment is what i need to use:

exiftool -GPSimgdirection+=-4294966935 -if '$GPSImgDirection > 360' *.JPG

This commandline succesfully finds and fixes Virb images with broken GPSImgDirection values.

Maybe the Mapillary website could include this?

1 Like

@Hjart thanks for your research notes regarding the metadata format from the Garmin Virb Elite model and EXIF format.

To improve reliability, the camera offset direction can be set using our open-source Command Line Tools on Github.

While using upload_with_preprocessing.py you would adjust the numeric value after the flag --offset_angle 0. Use together with --interpolate_directions. See the parser argument descriptions here:
https://github.com/mapillary/mapillary_tools/blob/master/python/upload_with_preprocessing.py.

Set 90 for right facing, 180 for rear facing, -90 for left facing.

As a workflow tip, when you are transferring files from your camera to your computer, create a new directory for each offset angle.

Thank you. The Garmin Virb Elite is quite reliable though (except for the small bug described above) and none of those tools will improve on it’s reliability.

Note that the device calculates image directions from the direction it’s moving and that I consider those slightly more reliable than interpolated directions calculated later by scripts etc

1 Like