Rerun C++ SDK
|
Archetype: Camera perspective projection (a.k.a. More...
#include <rerun/archetypes/pinhole.hpp>
Public Types | |
using | IndicatorComponent = rerun::components::IndicatorComponent< IndicatorComponentName > |
Indicator component, used to identify the archetype when converting to a list of components. | |
Public Member Functions | |
Pinhole | with_resolution (float width, float height) && |
Pixel resolution (usually integers) of child image space. | |
Pinhole | with_resolution (int width, int height) && |
Pixel resolution (usually integers) of child image space. | |
Pinhole (Pinhole &&other)=default | |
Pinhole (rerun::components::PinholeProjection _image_from_camera) | |
Pinhole | with_resolution (rerun::components::Resolution _resolution) && |
Pixel resolution (usually integers) of child image space. | |
Pinhole | with_camera_xyz (rerun::components::ViewCoordinates _camera_xyz) && |
Sets the view coordinates for the camera. | |
Pinhole | with_image_plane_distance (rerun::components::ImagePlaneDistance _image_plane_distance) && |
The distance from the camera origin to the image plane when the projection is shown in a 3D viewer. | |
Static Public Member Functions | |
static Pinhole | from_focal_length_and_resolution (const datatypes::Vec2D &focal_length, const datatypes::Vec2D &resolution) |
Creates a pinhole from the camera focal length and resolution, both specified in pixels. | |
static Pinhole | from_focal_length_and_resolution (float focal_length, const datatypes::Vec2D &resolution) |
Creates a symmetric pinhole from the camera focal length and resolution, both specified in pixels. | |
static Pinhole | from_fov_and_aspect_ratio (float fov_y, float aspect_ratio) |
Creates a pinhole from the camera vertical field of view (in radians) and aspect ratio (width/height). | |
Public Attributes | |
rerun::components::PinholeProjection | image_from_camera |
Camera projection, from image coordinates to view coordinates. | |
std::optional< rerun::components::Resolution > | resolution |
Pixel resolution (usually integers) of child image space. | |
std::optional< rerun::components::ViewCoordinates > | camera_xyz |
Sets the view coordinates for the camera. | |
std::optional< rerun::components::ImagePlaneDistance > | image_plane_distance |
The distance from the camera origin to the image plane when the projection is shown in a 3D viewer. | |
Static Public Attributes | |
static constexpr const char | IndicatorComponentName [] = "rerun.components.PinholeIndicator" |
Archetype: Camera perspective projection (a.k.a.
intrinsics).
|
static |
Creates a pinhole from the camera focal length and resolution, both specified in pixels.
The focal length is the diagonal of the projection matrix. Set the same value for x & y value for symmetric cameras, or two values for anamorphic cameras.
Assumes the principal point to be in the middle of the sensor.
|
inlinestatic |
Creates a symmetric pinhole from the camera focal length and resolution, both specified in pixels.
The focal length is the diagonal of the projection matrix.
Assumes the principal point to be in the middle of the sensor.
|
inlinestatic |
Creates a pinhole from the camera vertical field of view (in radians) and aspect ratio (width/height).
Assumes the principal point to be in the middle of the sensor.
|
inline |
Pixel resolution (usually integers) of child image space.
Width and height.
image_from_camera
project onto the space spanned by (0,0)
and resolution - 1
.
|
inline |
Pixel resolution (usually integers) of child image space.
Width and height.
image_from_camera
project onto the space spanned by (0,0)
and resolution - 1
.
|
inline |
Pixel resolution (usually integers) of child image space.
Width and height.
Example:
image_from_camera
project onto the space spanned by (0,0)
and resolution - 1
.
|
inline |
Sets the view coordinates for the camera.
All common values are available as constants on the components::ViewCoordinates
class.
The default is ViewCoordinates::RDF
, i.e. X=Right, Y=Down, Z=Forward, and this is also the recommended setting. This means that the camera frustum will point along the positive Z axis of the parent space, and the cameras "up" direction will be along the negative Y axis of the parent space.
The camera frustum will point whichever axis is set to F
(or the opposite of B
). When logging a depth image under this entity, this is the direction the point cloud will be projected. With RDF
, the default forward is +Z.
The frustum's "up" direction will be whichever axis is set to U
(or the opposite of D
). This will match the negative Y direction of pixel space (all images are assumed to have xyz=RDF). With RDF
, the default is up is -Y.
The frustum's "right" direction will be whichever axis is set to R
(or the opposite of L
). This will match the positive X direction of pixel space (all images are assumed to have xyz=RDF). With RDF
, the default right is +x.
Other common formats are RUB
(X=Right, Y=Up, Z=Back) and FLU
(X=Forward, Y=Left, Z=Up).
NOTE: setting this to something else than RDF
(the default) will change the orientation of the camera frustum, and make the pinhole matrix not match up with the coordinate system of the pinhole entity.
The pinhole matrix (the image_from_camera
argument) always project along the third (Z) axis, but will be re-oriented to project along the forward axis of the camera_xyz
argument.
|
inline |
The distance from the camera origin to the image plane when the projection is shown in a 3D viewer.
This is only used for visualization purposes, and does not affect the projection itself.
std::optional<rerun::components::Resolution> rerun::archetypes::Pinhole::resolution |
Pixel resolution (usually integers) of child image space.
Width and height.
Example:
image_from_camera
project onto the space spanned by (0,0)
and resolution - 1
.
std::optional<rerun::components::ViewCoordinates> rerun::archetypes::Pinhole::camera_xyz |
Sets the view coordinates for the camera.
All common values are available as constants on the components::ViewCoordinates
class.
The default is ViewCoordinates::RDF
, i.e. X=Right, Y=Down, Z=Forward, and this is also the recommended setting. This means that the camera frustum will point along the positive Z axis of the parent space, and the cameras "up" direction will be along the negative Y axis of the parent space.
The camera frustum will point whichever axis is set to F
(or the opposite of B
). When logging a depth image under this entity, this is the direction the point cloud will be projected. With RDF
, the default forward is +Z.
The frustum's "up" direction will be whichever axis is set to U
(or the opposite of D
). This will match the negative Y direction of pixel space (all images are assumed to have xyz=RDF). With RDF
, the default is up is -Y.
The frustum's "right" direction will be whichever axis is set to R
(or the opposite of L
). This will match the positive X direction of pixel space (all images are assumed to have xyz=RDF). With RDF
, the default right is +x.
Other common formats are RUB
(X=Right, Y=Up, Z=Back) and FLU
(X=Forward, Y=Left, Z=Up).
NOTE: setting this to something else than RDF
(the default) will change the orientation of the camera frustum, and make the pinhole matrix not match up with the coordinate system of the pinhole entity.
The pinhole matrix (the image_from_camera
argument) always project along the third (Z) axis, but will be re-oriented to project along the forward axis of the camera_xyz
argument.
std::optional<rerun::components::ImagePlaneDistance> rerun::archetypes::Pinhole::image_plane_distance |
The distance from the camera origin to the image plane when the projection is shown in a 3D viewer.
This is only used for visualization purposes, and does not affect the projection itself.