NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I've been taking photos with a sports camera (a Replay XD1080, like a GoPro) on my bike and recording a GPX track with my phone. This is a great set up, because the camera is designed to be mounted on a bicycle's handlebars, is waterproof, and has a mode where it takes one photo every 3 seconds.

I can correlate the pictures with the gpx track in JOSM using the Photo_geotagging (and photoadjust, if needed) plugins, but it does not set the compass angle in the image's exif tag, and mapillary goes ahead and assumes all images w/o a compass angle specified are facing north....

I thought I had seen an option somewhere to set the compass angle to follow the travel of the gpx track, which is a sensible feature, but can not find it anywhere now. I may have seen it somewhere other than JOSM, but if not JOSM it would have been in gottengeography or on the mappillary website itself, and have checked there too.

How do I set the compass angle to follow the gpx track?

asked 17 May '17, 19:32

keithonearth's gravatar image

keithonearth
2.9k5676108
accept rate: 13%

edited 18 May '17, 18:16


I use a similar setup with the mapillary_tools scripts.

For setting the compass angle only, specify --overwrite_EXIF_direction_tag in the image processing step below but don't specify --overwrite_EXIF_gps_tag.

My work flow for geo-tagging photos and uploading them to mapillary is processing and uploading is usually the following (on Linux):

Current version of mapillary_tools

Installation

Run the following commands for installing mapillary_tools:

Image Processing

Run the following command for adding GPS information to your photo's EXIF tags:

~/.local/bin/mapillary_tools process --verbose --advanced --rerun --user_name mapillary_user --interpolate_directions --overwrite_EXIF_gps_tag --overwrite_EXIF_direction_tag --duplicate_angle 360 --offset_time 1 --import_path "~/media/cam/" --geotag_source "gpx" --geotag_source_path "~/gpx/today.gpx"

Some explanations:

  • Replace mapillary_user with your mapillary user name
  • Replace ~/media/cam/ and ~/gpx/today.gpx with your photo and GPX path
  • --interpolate_directions tells it to interpolate the photo direction based on the GPX track
  • --duplicate_angle 360 tells it to ignore the angle when searching for duplicates, usefule since without GPS support your camera won't set a meaningful angle
  • --offset_time 1 specifies the offset to add to your GPX time stamps to synchronize with the photo timestamp from your camera clock

You can run mapillary_tools process --advanced -h to see all options and their description.

Upload

Run the following command to upload your photos:

~/.local/bin/mapillary_tools upload --verbose --advanced --skip_subfolders --number_threads 10 --max_attempts 10 --import_path "~/media/cam/"

Old answer for old version of mapillary_tools (before release v0.0.0)

export MAPILLARY_USERNAME=myname
export MAPILLARY_EMAIL=myaddress@domain.com
export MAPILLARY_PASSWORD=asdf1234

python geotag_from_gpx.py --time-offset 0 /path/to/images/ /path/to/track.gpx
python add_mapillary_tag_from_exif.py /path/to/images/
python remove_duplicates.py -p 360 /path/to/images/
python upload.py /path/to/images/
  • geotag_from_gpx.py adds the coordinates for each photo and also the heading based on the next photo. This is the most interesting script. You can use the --time-offset parameter if your camera's clock is out of sync with your GPS logger's clock. Ideally use JOSM afterwards to open a few photos and validate the geotagging.
  • add_mapillary_tag_from_exif.py adds a special tag to identify the photo sequence.
  • remove_duplicates.py removes duplicated photos taken at the same location. (Parameter -p 360 is important for ignoring the heading when searching for duplicates. This is because the script tries to keep photos at the same location if the heading changes significantly. But due to the previously executed geotag_from_gpx.py the heading for photos taken at the same location is almost random, leading to large heading variations and thus many duplicates being erroneously kept).
  • upload.py will simply upload the result to mapillary.
permanent link

answered 17 May '17, 21:07

scai's gravatar image

scai ♦
33.3k21309459
accept rate: 23%

edited 01 Jul '19, 12:48

This looks like just what I was after! The only issue I can see is that the clock on the camera and the clock on the GPS may differ by as much as a couple of minuets. This places the images in the wrong place if I do not adjust the time on the photos. The JOSM plugins make this easy enough, and I get good geolocation tags in the image's exif tags. I think that a fully automated process would not allow me to adjust the time on the images.

(17 May '17, 22:30) keithonearth
1

@keithonearth: The difference in clock can be corrected with the time-offset parameter of the first script. You can determine the difference by making a picture of the clock of your GPS (if that includes seconds), otherwise, make a waypoint at the same time you make a picture. I explain this in more detail in http://www.osm.be/2017/04/21/en-post-survey.html

(18 May '17, 04:19) escada

It also helps to start the time lapse and the GPS recording at the same time. I also use JOSM to validate the geotagging of the photos after running geotag_from_gpx.py.

(18 May '17, 07:38) scai ♦

I set it with the python script interpolate_direction.py from Mapillary. You can also use Javawa's fotogeotag

permanent link

answered 17 May '17, 21:40

ligfietser's gravatar image

ligfietser
2.9k52757
accept rate: 11%

1

Thanks! I found this script very helpful. especially as it works well with JOSM, which allows me to correlate with the gpx and tweak the locations in a program I'm familiar with.

(19 May '17, 07:24) keithonearth

After uploading your sequence, once you get the notification it's available on Mapillary, edit sequence and click on NORMALIZE (it will adjust the bearing of the photo in relation to the next one). No script needed.

Also for geotag I recommend GeoSetter, you can adjust timestamp with positive and negative values (which is extremely useful as you cannot sync HH:MM:SS between yours GPS/smartphone and the action camera (unless it's adjustable by the action cam app, as in GoPro Hero 5 or GoPro Session 5).

permanent link

answered 19 May '17, 11:46

lfttp's gravatar image

lfttp
56115
accept rate: 0%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×622
×27
×17
×13
×4

question asked: 17 May '17, 19:32

question was seen: 5,119 times

last updated: 01 Jul '19, 12:48

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum