Zivid C++ API 2.13.1+18e79e79-1
Zivid::Projection Namespace Reference

Classes

class  ProjectedImage
 A handle to a 2D image being displayed on Zivid camera's projector. More...
 

Functions

ZIVID_CORE_EXPORT std::ostream & operator<< (std::ostream &stream, const ProjectedImage &projectedImage)
 Serialize the value to a stream.
 
ZIVID_CORE_EXPORT Resolution projectorResolution (const Camera &camera)
 Returns the resolution of the internal projector in the Zivid camera.
 
ZIVID_CORE_EXPORT ProjectedImage showImage (Camera &camera, const Image< ColorBGRA > &image)
 Display a 2D color image using the projector.
 
ZIVID_CORE_EXPORT std::vector< PointXYpixelsFrom3DPoints (const Camera &camera, const std::vector< PointXYZ > &points)
 Get 2D projector pixel coordinates corresponding to 3D points relative to the camera.
 

Function Documentation

◆ operator<<()

ZIVID_CORE_EXPORT std::ostream & Zivid::Projection::operator<< ( std::ostream & stream,
const ProjectedImage & projectedImage )

Serialize the value to a stream.

◆ pixelsFrom3DPoints()

ZIVID_CORE_EXPORT std::vector< PointXY > Zivid::Projection::pixelsFrom3DPoints ( const Camera & camera,
const std::vector< PointXYZ > & points )

Get 2D projector pixel coordinates corresponding to 3D points relative to the camera.

This function takes 3D points in the camera's reference frame and converts them to the projector frame using the internal calibration of a Zivid camera. In a Zivid point cloud, each point corresponds to a pixel coordinate in the camera, but the projector has a slight offset. The translation of each point depends on the distance between the camera and the point, as well as the distance and angle between the camera and the projector.

Parameters
cameraReference to camera instance.
pointsList of 3D points in the camera frame
Returns
List of 2D projector pixel coordinates

◆ projectorResolution()

ZIVID_CORE_EXPORT Resolution Zivid::Projection::projectorResolution ( const Camera & camera)

Returns the resolution of the internal projector in the Zivid camera.

Returns
The projector resolution

◆ showImage()

ZIVID_CORE_EXPORT ProjectedImage Zivid::Projection::showImage ( Camera & camera,
const Image< ColorBGRA > & image )

Display a 2D color image using the projector.

The image resolution needs to be the same as the resolution obtained from the projectorResolution(const Camera &camera) function for the camera. To project the image, the returned projected image handle must be kept alive. The projection will stop when the handle goes out of scope, if the stop() function is called on the handle, or if another capture is initiated on the camera.

Parameters
cameraReference to camera instance
imageImage to display, provided in BGRA format
Returns
A handle to the projected image