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 (const Pinhole &other)=default | |
Pinhole & | operator= (const Pinhole &other)=default |
Pinhole & | operator= (Pinhole &&other)=default |
Pinhole (rerun::components::PinholeProjection _image_from_camera) | |
Pinhole | with_image_from_camera (const rerun::components::PinholeProjection &_image_from_camera) && |
Camera projection, from image coordinates to view coordinates. | |
Pinhole | with_many_image_from_camera (const Collection< rerun::components::PinholeProjection > &_image_from_camera) && |
This method makes it possible to pack multiple image_from_camera in a single component batch. | |
Pinhole | with_resolution (const rerun::components::Resolution &_resolution) && |
Pixel resolution (usually integers) of child image space. | |
Pinhole | with_many_resolution (const Collection< rerun::components::Resolution > &_resolution) && |
This method makes it possible to pack multiple resolution in a single component batch. | |
Pinhole | with_camera_xyz (const rerun::components::ViewCoordinates &_camera_xyz) && |
Sets the view coordinates for the camera. | |
Pinhole | with_many_camera_xyz (const Collection< rerun::components::ViewCoordinates > &_camera_xyz) && |
This method makes it possible to pack multiple camera_xyz in a single component batch. | |
Pinhole | with_image_plane_distance (const 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. | |
Pinhole | with_many_image_plane_distance (const Collection< rerun::components::ImagePlaneDistance > &_image_plane_distance) && |
This method makes it possible to pack multiple image_plane_distance in a single component batch. | |
Collection< ComponentColumn > | columns (const Collection< uint32_t > &lengths_) |
Partitions the component data into multiple sub-batches. | |
Collection< ComponentColumn > | columns () |
Partitions the component data into unit-length sub-batches. | |
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). | |
static Pinhole | update_fields () |
Update only some specific fields of a Pinhole . | |
static Pinhole | clear_fields () |
Clear all the fields of a Pinhole . | |
Public Attributes | |
std::optional< ComponentBatch > | image_from_camera |
Camera projection, from image coordinates to view coordinates. | |
std::optional< ComponentBatch > | resolution |
Pixel resolution (usually integers) of child image space. | |
std::optional< ComponentBatch > | camera_xyz |
Sets the view coordinates for the camera. | |
std::optional< ComponentBatch > | 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" |
static constexpr const char | ArchetypeName [] = "rerun.archetypes.Pinhole" |
The name of the archetype as used in ComponentDescriptor s. | |
static constexpr auto | Descriptor_image_from_camera |
ComponentDescriptor for the image_from_camera field. | |
static constexpr auto | Descriptor_resolution |
ComponentDescriptor for the resolution field. | |
static constexpr auto | Descriptor_camera_xyz |
ComponentDescriptor for the camera_xyz field. | |
static constexpr auto | Descriptor_image_plane_distance |
ComponentDescriptor for the image_plane_distance field. | |
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 |
This method makes it possible to pack multiple image_from_camera
in a single component batch.
This only makes sense when used in conjunction with columns
. with_image_from_camera
should be used when logging a single row's worth of data.
|
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 |
This method makes it possible to pack multiple resolution
in a single component batch.
This only makes sense when used in conjunction with columns
. with_resolution
should be used when logging a single row's worth of data.
|
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 |
This method makes it possible to pack multiple camera_xyz
in a single component batch.
This only makes sense when used in conjunction with columns
. with_camera_xyz
should be used when logging a single row's worth of data.
|
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.
|
inline |
This method makes it possible to pack multiple image_plane_distance
in a single component batch.
This only makes sense when used in conjunction with columns
. with_image_plane_distance
should be used when logging a single row's worth of data.
Collection< ComponentColumn > rerun::archetypes::Pinhole::columns | ( | const Collection< uint32_t > & | lengths_ | ) |
Partitions the component data into multiple sub-batches.
Specifically, this transforms the existing ComponentBatch
data into ComponentColumn
s instead, via ComponentBatch::partitioned
.
This makes it possible to use RecordingStream::send_columns
to send columnar data directly into Rerun.
The specified lengths
must sum to the total length of the component batch.
Collection< ComponentColumn > rerun::archetypes::Pinhole::columns | ( | ) |
Partitions the component data into unit-length sub-batches.
This is semantically similar to calling columns
with std::vector<uint32_t>(n, 1)
, where n
is automatically guessed.
std::optional<ComponentBatch> 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<ComponentBatch> 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<ComponentBatch> 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.
|
staticconstexpr |
ComponentDescriptor
for the image_from_camera
field.
|
staticconstexpr |
ComponentDescriptor
for the resolution
field.
|
staticconstexpr |
ComponentDescriptor
for the camera_xyz
field.
|
staticconstexpr |
ComponentDescriptor
for the image_plane_distance
field.