CesiumGS / cesium-ion-rest-api-examples

Code examples for using the Cesium ion REST API :earth_americas:
https://cesium.com/
35 stars 16 forks source link

Import geo-referenced photogrammetry mesh files #39

Closed Construkted-Reality closed 4 years ago

Construkted-Reality commented 5 years ago

Most photogrammetry software allows for geo-referencing the data, and allows for export of geo-referenced (obj, dae) mesh files.

It would be nice to be able to just import mesh files that have accurate geo-location data (based on ground control points specified within the photogrammetry software) rather then having to use the widget tool in the Cesium ion UI to roughly geo-locate the model.

OmarShehata commented 5 years ago

Examples of photogrammetry software that export geo-referenced data are Reality Capture and Agisoft PhotoScan. From discussion here: https://groups.google.com/d/msg/cesium-dev/8T3K85-u95U/Ym_mmS4ZBgAJ

mramato commented 5 years ago

Thanks for writing up this issue @outsider787. This is definitely something we want to support. The main issue is that every application seems to have their own way of storing this data, and in many cases don't publish the exact spec for what they are doing.

We still want to support it, it just needs to be on an app-by-app basis.

Are there particular apps you would like to see us support?

Construkted-Reality commented 5 years ago

Personally i would like to see Reality Capture supported first and second Agisoft PhotoScan.

What info do you need? I could open a ticket with both those apps and ask for whatever info you would need to get started on adding this feature.

mramato commented 5 years ago

Thanks @outsider787. Ideally, documentation from the software itself stating how to interpret their position output, but we could probably get buy looking out sample output and going from there. We're familiar with Context Capture and PhotoScan, but haven't worked with Reality Capture yet.

I see no reason why we won't support all 3, I just don't have an ETA yet for when that will happen. No action needed on your part. I'll bump this issue when we are actually starting to work on it.

Construkted-Reality commented 5 years ago

@mramato has there been any movement on this feature request?

hpinkos commented 5 years ago

@outsider787 no sorry, we haven't had a chance to look into this yet. We'll give you an update when we have one, thanks!

OmarShehata commented 5 years ago

@outsider787 do you have any sample output you can share here? Does the model itself have vertices in geographic coordinates, or is there a metadata file that lists the geographic projection/location?

russellar4 commented 4 years ago

Any progress on this?

Instead of having to support several different formats and how they store the coordinate system information, could you not just allow the user to specify the coordinate system and origin offset?

Only being able to upload an obj but with no coordinate system isn't very useful for geospatial application where data accuracy is important.

Thanks

OmarShehata commented 4 years ago

@russellar4 ideally ion can read the metadata that's already there, but allowing you to specify the CRS while uploading could be a good solution in the meantime or as a fallback.

For now, are you able to get your models visualized in the right place by locating them at the right location with the "Adjust Tileset Location" button after they're tiled?

russellar4 commented 4 years ago

I'm after engineering level precision, which isn't possible with manual geolocating.

If i reproject an obj to ECEF Coordinates then convert to gltf with the open source 3d tiles tools, I can position it accurately in Cesium. But this aproach doesn't scale to large models because it is a single tile.

The output from Cesium Ion is excellent for large models, but it just isn't possible to geolocate it accurately and it doesn't support data in ECEF coordinated either.

Cheers

OmarShehata commented 4 years ago

@russellar4 how do you currently reproject your OBJ to ECEF coordinates? I forgot to mention that the REST API does allow you to specify the location before tiling:

The origin of the tileset in [longitude, latitude, height] format in EPSG:4326 coordinates and height in meters.

But it sounds like you would also need ion to support converting the model coordinates using a given coordinate system. Would you be able to share samples of your data? That'll help move this along faster and make sure we're covering your use case. You can email omar@cesium.com if you want to share it privately.

OmarShehata commented 4 years ago

Requested over email - WebODM also seems to export a georeferenced mesh: https://docs.opendronemap.org/outputs.html#d-textured-model.

Not sure what coordinate system it uses.

OmarShehata commented 4 years ago

Pix4D exports a .xyz file that contains an offset that can be used to geolocate a mesh. See: https://support.pix4d.com/hc/en-us/articles/204606535-How-to-visualize-the-3D-textured-mesh-with-georeference. Assuming the coordinate system being used is WGS84, those could be passed/read directly by ion to position the model correctly. Otherwise, it outputs a .proj that describes what coordinate system those XYZ coordinates are in.

In either case the model vertices are always in a local coordinate system.

OmarShehata commented 4 years ago

We're migrating the issues in this repository to consolidate questions, Cesium ion feature requests, and bug reports on the Cesium community forum, that way there'll be one place to search for answers.

This issue has been moved here: https://community.cesium.com/t/support-tiling-georeferenced-3d-models-into-3d-tiles/10524