API: accessing metadata available in the web interface but not documented in the API (contributor and equipment) and calculating the field of view

I’d like to retrieve the two following pieces of information for images through the API. Both are available in the web interface, but do not appear in the API Documentation (V4):

  • Contributor (Captured by)
  • Device used / camera model (Captured with)

Does someone know whether that is possible (but for some reason not documented)?

On a related note, I am looking to calculate the field of view (in degrees) of an image. There are two relevant fields supported by the API:

camera_parameters - array of float, focal length, k1, k2. See OpenSfM for details.
camera_type - enum, type of camera projection: “perspective”, “fisheye”, “equirectangular” (or equivalently “spherical”)

But none gives the precise field of view (except in general whether it’s panoramic or not). The focal length appears to be in mm of the device (e.g. for one, I have seen the value of 0.85), from which I understand it is not possible to calculate the field of view in degrees. If the information on the camera model is available (first part of my question), it could help, but nowadays some devices like the recent iPhones have multiple cameras so it won’t be always unambiguous.

I haven’t used previous versions of the API so I don’t know if these fields have been supported before.

3 Likes

Hi @fbsg - an update on this question - contributor and device has been added to the Mapillary API to make this workflow possible.

You can now filter by user in the Mapillary API as well as by camera. Please take a look at the updated API documentation (note the “creator_username” “make” and “model” fields).

We hope this is helpful!

2 Likes

Hi,

That is great news!

I am working with the Mapillary API to retrieve information about images using a list of image IDs. However, I encountered an InvalidFieldError: The invalid field, “creator” was passed to the endpoint, “https://graph.mapillary.com/:image_id?fields=”` when trying to include specific fields such as “creator,” “make,” “model,” “is_pano,” and “detections” in my API request.

I noticed that if I remove these new fields from the request, I can successfully retrieve the information. Do you have any advice?

fields_to_pass_for_the_image = [ ‘camera_parameters’, ‘camera_type’, ‘captured_at’, ‘compass_angle’, ‘computed_altitude’, ‘computed_compass_angle’, ‘computed_geometry’,
‘computed_rotation’, ‘exif_orientation’, ‘quality_score’,
‘height’, ‘width’, ‘sequence’, ‘thumb_2048_url’, ‘creator’,
‘make’,‘model’, ‘is_pano’,‘detections’]
response = Client().get(Entities.get_image(image_id=‘322873982524075’, fields=fields_to_pass_for_the_image))
data = json.loads(response.content.decode(‘utf-8’))

cc: @chrisbeddow

Hi @neginzr ! The creator field currently only appears when you do image search, and not a specific ID. This is an interesting use case though, if you know the image but want to get its metadata it is reasonable to expect creator name/id as one. Let me me make a request for this.

1 Like

@neginzr With this request it actually does return creator:

https://graph.mapillary.com/483396719741954?fields=id,make,model,creator&access_token=***

Can you test that?

I do not see detections working as a field.

Issue found: some images just have “empty” list of detections, so it will vary by image. If the image is older than 2022 this could be a risk and we are fixing this in batches.

I see your example is from 2019 @neginzr so this is where we have missing detection data that needs to be regenerated.

Thats great application Chiris, thanks for the comments and advice to access the creators and detections fields. I would apply them to gather related information to my data.