descriptionSimulation of RGB and Time-of-Flight depth cameras
ownerMartin Lambers <>
last changeWed, 23 Oct 2019 06:57:18 +0000 (08:57 +0200)



This is a camera simulation library developed at the Computer Graphics Group, University of Siegen.

Supported cameras types:



Only Qt is required, nothing else. You can optionally use external libraries to extent functionality:

First build and install libcamsim. Then compile and link your application against the installed version of libcamsim (not against the files in its build directories).


Libcamsim requires an OpenGL 4.5 core context. You should typically create such a context using an offscreen surface (see the examples).

There is Doxygen-style documentation (build with CAMSIM_BUILD_DOCUMENTATION=ON to generate HTML), but the best starting point is probably to look at the example programs.

If you want to display results in an interactive application, create another context that shares OpenGL objects with the libcamsim context, so that you can render the textures that libcamsim produces. If you do this, you might need to call glFinish() on the libcamsim context after calling simulate() to make sure the result textures are finished before reusing them in another OpenGL context, since there is no implicit synchronization between contexts.

If you want to use multiple GPUs, create offscreen contexts for each of them (this step is system dependent). Contexts on different GPUs cannot share objects, so each of these contexts must get its own scene and simulator instances. For example, if you import a model file, you must add its contents to all scene instances.

Note that the bottleneck is almost always the export, not the simulation itself! Export data without compression, and use a write-efficient file format! For example, simulating and exporting 125 floating point RGB frames of size 800x600 took the following time in seconds for different file formats, without compression: 1.5 (raw), 1.5 (gta), 4.9 (ppm), 7.0 (pfs), 7.0 (mat), 7.2 (png), 7.2 (h5), 118 (csv). Most of the time, it is a good idea to export .raw or .gta and postprocess / convert these results afterwards.

Relevant Papers

The following papers are relevant for CamSim. If you use this software, please cite the appropriate paper, depending on the features you are using:

2019-10-23 Martin LambersAdd camsim-pmd-hcibox example master
2019-08-26 Martin LambersRemove obsolete FindGTA.cmake
2019-04-18 Martin LambersEnable mipmaps for imported textures.
2019-04-17 Martin LambersUse CMAKE_CXX_STANDARD instead of setting compiler...
2019-03-20 Martin LambersFix CSV export of floating point data
2019-02-19 Martin LambersFix formatting
2018-12-19 Martin LambersAdd comment about qt5-image-format-plugins
2018-12-18 Martin LambersMove random number generation to the GPU
2018-12-17 Martin LambersFix import of aiTextureMapMode. This fixes the Sponza...
2018-12-14 Martin LambersApplications: use CamSim::Context for simplicity
2018-12-14 Martin LambersAdd CamSim::Context class to provide a suitable OpenGL...
2018-12-14 Martin LambersInitialize variable to silence valgrind warning.
2018-11-30 Martin LambersAdd conversion of PMD range to cartesian coordinates...
2018-11-05 Martin LambersImprove PMD example.
2018-10-09 Martin LambersAdd missing <QFile> include.
2018-10-09 Martin LambersFix warnings about unused variables.
6 weeks ago master