ImFusion C++ SDK 4.5.0
ImFusion::SimulatorRenderer Class Reference

#include <ImFusion/Vision/SimulatorRenderer.h>

Renderer for simulating RGB-D sensor output from 3D models. More...

Detailed Description

Renderer for simulating RGB-D sensor output from 3D models.

This class provides functionality to render synthetic RGB-D frames from a set of 3D meshes and a camera configuration. It supports semantic labeling and rendering of surface coordinates.

Usage:

  • Set the camera using setCamera().
  • Set the 3D model(s) using setModel().
  • Configure label mode and surface coordinate rendering as needed.
  • Call render() with a pose to generate a SimulatorFrame.

Important aspects:

  • Supports face and vertex label modes for semantic segmentation.
  • Can render surface coordinates (xyz maps) in addition to color, depth, and label images.
  • Not thread-safe.

Example:

renderer.setColorCamera(colorCameraComponent);
renderer.setDepthCamera(depthCameraComponent);
renderer.setModel(meshes);
auto frame = renderer.render(poseMatrix);
auto colorImg = frame->colorImage();
auto depthImg = frame->depthImage();
@ FaceLabel
Uses the labels of faces.
Definition SimulatorRenderer.h:123
void setRenderSurfaceCoordinates(bool value)
Enables or disables rendering of surface coordinates (xyz maps).
Definition SimulatorRenderer.h:134
std::unique_ptr< SimulatorFrame > render(const mat4 &T)
Renders a frame from the current model and camera at the given pose.
void setLabelMode(LabelMode mode)
Sets the source of label for creating the semantic segmentation image.
Definition SimulatorRenderer.h:129
void setDepthCamera(CameraCalibrationDataComponent &camera)
Sets the depth camera configuration.
void setColorCamera(CameraCalibrationDataComponent &camera)
Sets the color camera configuration.
SimulatorRenderer()
Constructs a SimulatorRenderer.
void setModel(const std::vector< Mesh * > &meshes)
Sets the 3D model(s) to be rendered.

Public Types

enum  LabelMode { FaceLabel = 0 , VertexLabel = 1 }
 Source of labels to use for creating the label maps. More...

Public Member Functions

 SimulatorRenderer ()
 Constructs a SimulatorRenderer.
 ~SimulatorRenderer ()
 Destructor.
void setColorCamera (CameraCalibrationDataComponent &camera)
 Sets the color camera configuration.
CameraCalibrationDataComponentcolorCamera ()
void setDepthCamera (CameraCalibrationDataComponent &camera)
 Sets the depth camera configuration.
CameraCalibrationDataComponentdepthCamera ()
void setModel (const std::vector< Mesh * > &meshes)
 Sets the 3D model(s) to be rendered.
std::vector< Mesh * > model () const
 Returns the current 3D model(s).
void setLabelMode (LabelMode mode)
 Sets the source of label for creating the semantic segmentation image.
LabelMode labelMode () const
 Returns the source of label for creating the semantic segmentation image.
void setRenderSurfaceCoordinates (bool value)
 Enables or disables rendering of surface coordinates (xyz maps).
bool renderSurfaceCoordinates () const
 Returns whether rendering of surface coordinates is enabled.
std::unique_ptr< SimulatorFramerender (const mat4 &T)
 Renders a frame from the current model and camera at the given pose.

Member Enumeration Documentation

◆ LabelMode

Source of labels to use for creating the label maps.

Enumerator
FaceLabel 

Uses the labels of faces.

VertexLabel 

Uses the labels of vertices.

Member Function Documentation

◆ setLabelMode()

void ImFusion::SimulatorRenderer::setLabelMode ( LabelMode mode)
inline

Sets the source of label for creating the semantic segmentation image.

The mode is not updated if the provided value is incompatible.

◆ render()

std::unique_ptr< SimulatorFrame > ImFusion::SimulatorRenderer::render ( const mat4 & T)

Renders a frame from the current model and camera at the given pose.

Returns
Unique pointer to the rendered SimulatorFrame.

The documentation for this class was generated from the following file:
  • ImFusion/Vision/SimulatorRenderer.h
Search Tab / S to search, Esc to close