Open3D (C++ API)  0.12.0
Functions
open3d::core::eigen_converter Namespace Reference

Functions

std::vector< Eigen::Vector3d > TensorToEigenVector3dVector (const core::Tensor &tensor)
 
std::vector< Eigen::Vector3i > TensorToEigenVector3iVector (const core::Tensor &tensor)
 
core::Tensor EigenVector3dVectorToTensor (const std::vector< Eigen::Vector3d > &values, core::Dtype dtype, const core::Device &device)
 
core::Tensor EigenVector3iVectorToTensor (const std::vector< Eigen::Vector3i > &values, core::Dtype dtype, const core::Device &device)
 
template<class T , int M, int N, int A>
core::Tensor EigenMatrixToTensor (const Eigen::Matrix< T, M, N, A > &matrix)
 

Function Documentation

◆ EigenMatrixToTensor()

template<class T , int M, int N, int A>
core::Tensor open3d::core::eigen_converter::EigenMatrixToTensor ( const Eigen::Matrix< T, M, N, A > &  matrix)

Converts a Eigen matrix of shape (M, N) with alignment A and type T to a Tensor.

Parameters
matrixA templated Eigen matrix.
Returns
A tensor converted from the eigen matrix.

◆ EigenVector3dVectorToTensor()

core::Tensor open3d::core::eigen_converter::EigenVector3dVectorToTensor ( const std::vector< Eigen::Vector3d > &  values,
core::Dtype  dtype,
const core::Device device 
)

Converts a vector of Eigen::Vector3d to a (N, 3) tensor. This function also takes care of dtype conversion and device transfer if necessary.

Parameters
valuesA vector of Eigen::Vector3d values, e.g. a list of 3D points.
dtypeDtype of the output tensor.
deviceDevice of the output tensor.
Returns
A tensor of shape (N, 3) with the specified dtype and device.

◆ EigenVector3iVectorToTensor()

core::Tensor open3d::core::eigen_converter::EigenVector3iVectorToTensor ( const std::vector< Eigen::Vector3i > &  values,
core::Dtype  dtype,
const core::Device device 
)

Converts a vector of Eigen::Vector3i to a (N, 3) tensor. This function also takes care of dtype conversion and device transfer if necessary.

Parameters
valuesA vector of Eigen::Vector3i values, e.g. a list of 3D points.
dtypeDtype of the output tensor.
deviceDevice of the output tensor.
Returns
A tensor of shape (N, 3) with the specified dtype and device.

◆ TensorToEigenVector3dVector()

std::vector< Eigen::Vector3d > open3d::core::eigen_converter::TensorToEigenVector3dVector ( const core::Tensor tensor)

Converts a tensor of shape (N, 3) to std::vector<Eigen::Vector3d>. An exception will be thrown if the tensor shape is not (N, 3). Regardless of the tensor dtype, the output will be converted to to double.

Parameters
tensorA tensor of shape (N, 3).
Returns
A vector of N Eigen::Vector3d values.

◆ TensorToEigenVector3iVector()

std::vector< Eigen::Vector3i > open3d::core::eigen_converter::TensorToEigenVector3iVector ( const core::Tensor tensor)

Converts a tensor of shape (N, 3) to std::vector<Eigen::Vector3i>. An exception will be thrown if the tensor shape is not (N, 3). Regardless of the tensor dtype, the output will be converted to to double.

Parameters
tensorA tensor of shape (N, 3).
Returns
A vector of N Eigen::Vector3i values.