mapillary / metropolis_sdk

A collection of code examples to help users get started with the Mapillary Metropolis dataset
Other
19 stars 4 forks source link

Does PointCloud have geographical coordinates available? #4

Open ZGX010 opened 9 months ago

ZGX010 commented 9 months ago

Hi Mapillary Team,

This is really a great job. I found that the point cloud data of Mapillary Metropolis are all in the NED coordinate system and do not have geographical information such as longitude and latitude. However, I want to fuse my own data with your data. It would be great if I could know which city the data comes from.

regards ~

podgorki commented 2 weeks ago

@ZGX010 the SDK has a topographic converter in metropolis.utils.geo that you can use to get the lat lon

The following is an example of the basic usage:

from metropolis.utils.geo import TopocentricConverter
from metropolis import Metropolis

metropolis = Metropolis(
    <split>,  # Name of the split we want to load
    <your_path_metropolis>,  # Path to the root directory of the dataset
)

converter = TopocentricConverter(
    metropolis.geo["reference"]["lat"],
    metropolis.geo["reference"]["lon"],
    metropolis.geo["reference"]["alt"],
)

#  """Convert topocentric x, y, z to lat, lon, alt."""
y_c_lla, x_c_lla, _ = converter.to_lla(
    pose_record["translation"][0],
    pose_record["translation"][1],
    pose_record["translation"][2],
)

With scene token 'trABmlDfsN1z6XCSJgFQxO' and sample token: '1pVhDEWnyS30UKoGObXQBg' you get the vehicles coordinate as: (42.331381982273605, -83.04600496139498)

This give the address as 60 Cadillac Square, Detroit, MI 48226, USA.