NDEVR
API Documentation
DepthAISmoother

A ViewportPointSmoother specialized for DepthAI cameras, converting between pixel coordinates and 3D points using the camera's intrinsic matrix. More...

Collaboration diagram for DepthAISmoother:
[legend]

Public Member Functions

 DepthAISmoother (const Vector< 2, uint04 > &size, const Matrix< fltp04 > &intrinsics)
 Constructs the smoother with the camera's native size and intrinsic matrix.
DepthAISmootherclone ()
 Creates a copy of this smoother with the same parameters.
Vertex< 3, fltp04pixelToPoint (Vertex< 3, fltp04 > pixel) const final override
 Converts a pixel coordinate with depth into a 3D point.
Vertex< 2, fltp04pointToPixel (Vertex< 3, fltp04 > location) const final override
 Projects a 3D point onto the image plane as a pixel coordinate.
void setViewSize (const Vector< 2, uint04 > &view_size) final override
 Updates the viewport size and recalculates pixel scaling factors.

Protected Attributes

Matrix< fltp04m_intrinics
 Camera intrinsic matrix (fx, fy, cx, cy).
Vector< 2, fltp04m_inv_fov
 Inverse focal lengths (1/fx, 1/fy).
fltp04 m_inv_pixel_multiplier = 1.0f
 Inverse of the pixel multiplier.
Vector< 2, uint04m_original_size
 Native camera image resolution.
fltp04 m_pixel_multiplier = 1.0f
 Scale factor from native to current viewport size.

Detailed Description

A ViewportPointSmoother specialized for DepthAI cameras, converting between pixel coordinates and 3D points using the camera's intrinsic matrix.


Definition at line 11 of file DepthAIPointSmoother.h.

Constructor & Destructor Documentation

◆ DepthAISmoother()

DepthAISmoother::DepthAISmoother ( const Vector< 2, uint04 > & size,
const Matrix< fltp04 > & intrinsics )
inline

Constructs the smoother with the camera's native size and intrinsic matrix.

Parameters
[in]sizeThe native image resolution of the camera.
[in]intrinsicsThe 4x4 camera intrinsic matrix (fx, fy, cx, cy).

Definition at line 17 of file DepthAIPointSmoother.h.

References Vector< t_dims, t_type >::as(), m_intrinics, m_inv_fov, and m_original_size.

Referenced by clone().

Member Function Documentation

◆ clone()

DepthAISmoother * DepthAISmoother::clone ( )
inline

Creates a copy of this smoother with the same parameters.

Returns
A new DepthAISmoother instance.

Definition at line 61 of file DepthAIPointSmoother.h.

References DepthAISmoother(), m_intrinics, m_original_size, and setViewSize().

◆ pixelToPoint()

Vertex< 3, fltp04 > DepthAISmoother::pixelToPoint ( Vertex< 3, fltp04 > pixel) const
inlinefinaloverride

Converts a pixel coordinate with depth into a 3D point.

Parameters
[in]pixelThe pixel (x, y, depth) to convert.
Returns
The 3D point in camera space.

Definition at line 29 of file DepthAIPointSmoother.h.

References m_intrinics, m_inv_fov, and m_inv_pixel_multiplier.

◆ pointToPixel()

Vertex< 2, fltp04 > DepthAISmoother::pointToPixel ( Vertex< 3, fltp04 > location) const
inlinefinaloverride

Projects a 3D point onto the image plane as a pixel coordinate.

Parameters
[in]locationThe 3D point in camera space.
Returns
The 2D pixel coordinate.

Definition at line 41 of file DepthAIPointSmoother.h.

References m_intrinics, and m_pixel_multiplier.

◆ setViewSize()

void DepthAISmoother::setViewSize ( const Vector< 2, uint04 > & view_size)
inlinefinaloverride

Updates the viewport size and recalculates pixel scaling factors.

Parameters
[in]view_sizeThe new viewport size in pixels.

Definition at line 53 of file DepthAIPointSmoother.h.

References cast(), m_inv_pixel_multiplier, m_original_size, and m_pixel_multiplier.

Referenced by clone().


The documentation for this class was generated from the following file: