Giter VIP home page Giter VIP logo

cesium-simple-photogrammetry's Introduction

From the real to the virtual world

A number of Doarama users have expressed interest in augmenting the Cesium WebGL Virtual Globe with custom meshes. For example this might include a 3D model generated from photos captured by a drone. It is now relatively straightforward to capture 3D objects from the real world using photogrammetry. Provided the 3D model is not too complex, it can be brought directly into Cesium for display. In the following example we'll proceed from photos taken of a toy bulldozer through to a 3D model visualised in Cesium using glTF. Note that emphasis is placed on workflow rather than the quality of the 3D model.

View the live demo

Cesium screengrab

Capture

Your photogrammetry software should provide recommendations on how to take photos to provide best results. In general the technique will work best on non-shiny objects, and you'll want to provide some overlap between the photos you take.

For this test a simple consumer Panasonic Lumix DMC-ZR1 was used, and the quality of the 3D model reconstruction would have benefited from a greater number of pictures take.

Process

There are a number of photogrammetry software solutions available with different licensing and costs. Here's some as a starting point...

For simplicity we'll use a free trial of Agisoft PhotoScan Standard Edition (normally US$179).

PhotoScan

The processing in PhotoScan has multiple stages with a few simple options for each stage. These stages are shown under the 'Workflow' menu. For the purpose of this test we'll just stick to the defaults options.

  • Add photos
  • Align photos (this will create a sparse point cloud)
  • Build dense point cloud
  • Build mesh
  • Build texture

The whole process took around 15 mins to generate this model from photos. Obviously timing will vary depending on the quality and size of the model you require. Once you have done these steps you can use the File menu to export the model as Collada

Postprocess

I wasn't able to convert the PhotoScan Collada model directly to glTF due to an issue with the exporter. To work around this I used the OpenCollada Maya plugin (builds here) to import the model, then re-assigned the shader (as a Maya surface shader). I also trimmed some polygons from the mesh. The model was then re-exported again with the OpenCollada Maya plugin. Make sure texture paths in the Collada model are relative (e.g. change file://path/to/my/file.jpg to file.jpg).

Convert

Use the Cesium online converter to convert the model to glTF. If successful you should see a preview of the model in the window. Any glTF conversion problems can be reported to glTF issues.

Load into Cesium

The final step is to load and geolocate your model. For this test I've created a simple CZML for loading into Cesium and have manually geolocated it, paying no attention to accurate scale.

cesium-simple-photogrammetry's People

Contributors

chris-cooper avatar pjcozzi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.