![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Functions | |
| template<typename func_t > | |
| static void | LaunchIndexFillKernel (const Indexer &indexer, const func_t &func) |
| template<typename T > | |
| static Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | TensorToEigenMatrix (const core::Tensor &tensor) |
| Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | TensorToEigenMatrixXd (const core::Tensor &tensor) |
| Converts a 2D tensor to Eigen::MatrixXd of same shape. Regardless of the tensor dtype, the output will be converted to double. More... | |
| Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | TensorToEigenMatrixXf (const core::Tensor &tensor) |
| Converts a 2D tensor to Eigen::MatrixXf of same shape. Regardless of the tensor dtype, the output will be converted to float. More... | |
| Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | TensorToEigenMatrixXi (const core::Tensor &tensor) |
| Converts a 2D tensor to Eigen::MatrixXi of same shape. Regardless of the tensor dtype, the output will be converted to int. More... | |
| template<typename T , int N> | |
| static std::vector< Eigen::Matrix< T, N, 1 > > | TensorToEigenVectorNxVector (const core::Tensor &tensor) |
| template<typename T , int N> | |
| static core::Tensor | EigenVectorNxVectorToTensor (const std::vector< Eigen::Matrix< T, N, 1 >> &values, core::Dtype dtype, const core::Device &device) |
| std::vector< Eigen::Vector2d > | TensorToEigenVector2dVector (const core::Tensor &tensor) |
| Converts a tensor of shape (N, 2) to std::vector<Eigen::Vector2d>. An exception will be thrown if the tensor shape is not (N, 2). Regardless of the tensor dtype, the output will be converted to double. More... | |
| std::vector< Eigen::Vector3d > | 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 double. More... | |
| std::vector< Eigen::Vector3i > | 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 int. More... | |
| std::vector< Eigen::Vector2i > | TensorToEigenVector2iVector (const core::Tensor &tensor) |
| Converts a tensor of shape (N, 2) to std::vector<Eigen::Vector2i>. An exception will be thrown if the tensor shape is not (N, 2). Regardless of the tensor dtype, the output will be converted to int. More... | |
| core::Tensor | 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. More... | |
| core::Tensor | EigenVector2dVectorToTensor (const std::vector< Eigen::Vector2d > &values, core::Dtype dtype, const core::Device &device) |
| Converts a vector of Eigen::Vector2d to a (N, 2) tensor. This function also takes care of dtype conversion and device transfer if necessary. More... | |
| core::Tensor | 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. More... | |
| core::Tensor | EigenVector2iVectorToTensor (const std::vector< Eigen::Vector2i > &values, core::Dtype dtype, const core::Device &device) |
| Converts a vector of Eigen::Vector2i to a (N, 2) tensor. This function also takes care of dtype conversion and device transfer if necessary. More... | |
| template<class Derived > | |
| core::Tensor | EigenMatrixToTensor (const Eigen::MatrixBase< Derived > &matrix) |
| Converts a eigen matrix of shape (M, N) with alignment A and type T to a tensor. More... | |
| core::Tensor cloudViewer::core::eigen_converter::EigenMatrixToTensor | ( | const Eigen::MatrixBase< Derived > & | matrix | ) |
Converts a eigen matrix of shape (M, N) with alignment A and type T to a tensor.
| matrix | An eigen matrix (e.g. Eigen::Matrix3f) or vector (e.g. Eigen::Vector3d). |
Definition at line 29 of file EigenConverter.h.
Referenced by cloudViewer::t::pipelines::registration::BenchmarkDopplerICP(), cloudViewer::t::geometry::kernel::minimum_obb::ComputeMinimumOBBApprox(), cloudViewer::t::pipelines::slac::FillInRigidAlignmentTerm(), cloudViewer::t::pipelines::slac::FillInSLACAlignmentTerm(), cloudViewer::t::geometry::AxisAlignedBoundingBox::FromLegacy(), cloudViewer::t::geometry::OrientedBoundingBox::FromLegacy(), cloudViewer::t::pipelines::slac::SaveCorrespondencesForPointClouds(), and cloudViewer::t::pipelines::slac::UpdatePoses().
| core::Tensor cloudViewer::core::eigen_converter::EigenVector2dVectorToTensor | ( | const std::vector< Eigen::Vector2d > & | values, |
| core::Dtype | dtype, | ||
| const core::Device & | device | ||
| ) |
Converts a vector of Eigen::Vector2d to a (N, 2) tensor. This function also takes care of dtype conversion and device transfer if necessary.
| values | A vector of Eigen::Vector2d values, e.g. a list of UV coordinates. |
| dtype | Dtype of the output tensor. |
| device | Device of the output tensor. |
Definition at line 172 of file EigenConverter.cpp.
References EigenVectorNxVectorToTensor().
Referenced by cloudViewer::t::geometry::TriangleMesh::FromLegacy().
| core::Tensor cloudViewer::core::eigen_converter::EigenVector2iVectorToTensor | ( | const std::vector< Eigen::Vector2i > & | values, |
| core::Dtype | dtype, | ||
| const core::Device & | device | ||
| ) |
Converts a vector of Eigen::Vector2i to a (N, 2) tensor. This function also takes care of dtype conversion and device transfer if necessary.
| values | A vector of Eigen::Vector2i values, e.g. a list of 2D points / indices. |
| dtype | Dtype of the output tensor. |
| device | Device of the output tensor. |
Definition at line 185 of file EigenConverter.cpp.
References EigenVectorNxVectorToTensor().
Referenced by cloudViewer::t::geometry::LineSet::FromLegacy().
| core::Tensor cloudViewer::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.
| values | A vector of Eigen::Vector3d values, e.g. a list of 3D points. |
| dtype | Dtype of the output tensor. |
| device | Device of the output tensor. |
Definition at line 165 of file EigenConverter.cpp.
References EigenVectorNxVectorToTensor().
Referenced by cloudViewer::t::geometry::TriangleMesh::FromLegacy(), cloudViewer::t::geometry::LineSet::FromLegacy(), and cloudViewer::t::geometry::PointCloud::FromLegacy().
| core::Tensor cloudViewer::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.
| values | A vector of Eigen::Vector3i values, e.g. a list of 3D points. |
| dtype | Dtype of the output tensor. |
| device | Device of the output tensor. |
Definition at line 179 of file EigenConverter.cpp.
References EigenVectorNxVectorToTensor().
Referenced by cloudViewer::t::geometry::TriangleMesh::FromLegacy().
|
static |
Definition at line 113 of file EigenConverter.cpp.
References cloudViewer::core::ALL_SAME, DISPATCH_DTYPE_TO_TEMPLATE, cloudViewer::core::Tensor::Empty(), indexer, LaunchIndexFillKernel(), and cloudViewer::core::Tensor::To().
Referenced by EigenVector2dVectorToTensor(), EigenVector2iVectorToTensor(), EigenVector3dVectorToTensor(), and EigenVector3iVectorToTensor().
|
static |
Fills tensor[:][i] with func(i).
| indexer | The input tensor and output tensor to the indexer are the same (as a hack), since the tensor are filled in-place. |
| func | A function that takes pointer location and workload index i, computes the value to fill, and fills the value at the pointer location. |
Definition at line 28 of file EigenConverter.cpp.
References indexer, and cloudViewer::core::ParallelFor().
Referenced by EigenVectorNxVectorToTensor().
|
static |
| Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > cloudViewer::core::eigen_converter::TensorToEigenMatrixXd | ( | const core::Tensor & | tensor | ) |
Converts a 2D tensor to Eigen::MatrixXd of same shape. Regardless of the tensor dtype, the output will be converted to double.
| tensor | A 2D tensor. |
Definition at line 67 of file EigenConverter.cpp.
Referenced by cloudViewer::t::geometry::OrientedBoundingBox::ToLegacy().
| Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > cloudViewer::core::eigen_converter::TensorToEigenMatrixXf | ( | const core::Tensor & | tensor | ) |
Converts a 2D tensor to Eigen::MatrixXf of same shape. Regardless of the tensor dtype, the output will be converted to float.
| tensor | A 2D tensor. |
Definition at line 72 of file EigenConverter.cpp.
Referenced by cloudViewer::t::pipelines::slac::UpdatePoses().
| Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > cloudViewer::core::eigen_converter::TensorToEigenMatrixXi | ( | const core::Tensor & | tensor | ) |
Converts a 2D tensor to Eigen::MatrixXi of same shape. Regardless of the tensor dtype, the output will be converted to int.
| tensor | A 2D tensor. |
Definition at line 77 of file EigenConverter.cpp.
| std::vector< Eigen::Vector2d > cloudViewer::core::eigen_converter::TensorToEigenVector2dVector | ( | const core::Tensor & | tensor | ) |
Converts a tensor of shape (N, 2) to std::vector<Eigen::Vector2d>. An exception will be thrown if the tensor shape is not (N, 2). Regardless of the tensor dtype, the output will be converted to double.
| tensor | A tensor of shape (N, 2). |
Definition at line 145 of file EigenConverter.cpp.
Referenced by cloudViewer::t::geometry::TriangleMesh::ToLegacy().
| std::vector< Eigen::Vector2i > cloudViewer::core::eigen_converter::TensorToEigenVector2iVector | ( | const core::Tensor & | tensor | ) |
Converts a tensor of shape (N, 2) to std::vector<Eigen::Vector2i>. An exception will be thrown if the tensor shape is not (N, 2). Regardless of the tensor dtype, the output will be converted to int.
| tensor | A tensor of shape (N, 2). |
Definition at line 160 of file EigenConverter.cpp.
Referenced by cloudViewer::t::geometry::LineSet::ToLegacy().
| std::vector< Eigen::Vector3d > cloudViewer::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 double.
| tensor | A tensor of shape (N, 3). |
Definition at line 150 of file EigenConverter.cpp.
Referenced by cloudViewer::t::geometry::kernel::minimum_obb::ComputeMinimumOBBApprox(), cloudViewer::t::geometry::kernel::minimum_obb::ComputeMinimumOBBJylanki(), cloudViewer::t::geometry::OrientedBoundingBox::CreateFromPoints(), cloudViewer::t::geometry::AxisAlignedBoundingBox::ToLegacy(), cloudViewer::t::geometry::OrientedBoundingBox::ToLegacy(), cloudViewer::t::geometry::LineSet::ToLegacy(), cloudViewer::t::geometry::PointCloud::ToLegacy(), and cloudViewer::t::geometry::TriangleMesh::ToLegacy().
| std::vector< Eigen::Vector3i > cloudViewer::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 int.
| tensor | A tensor of shape (N, 3). |
Definition at line 155 of file EigenConverter.cpp.
Referenced by cloudViewer::t::pipelines::slac::ControlGrid::Compactify(), cloudViewer::t::geometry::kernel::minimum_obb::ComputeMinimumOBBApprox(), cloudViewer::t::geometry::kernel::minimum_obb::ComputeMinimumOBBJylanki(), and cloudViewer::t::geometry::TriangleMesh::ToLegacy().
|
static |
Definition at line 82 of file EigenConverter.cpp.
References AssertTensorShape, cloudViewer::core::Dtype::ByteSize(), cloudViewer::core::Tensor::Contiguous(), cloudViewer::core::Float64, cloudViewer::core::Tensor::GetDataPtr(), cloudViewer::core::Tensor::GetDevice(), cloudViewer::core::Tensor::GetDtype(), cloudViewer::core::Tensor::GetLength(), cloudViewer::core::Int32, LogError, cloudViewer::core::MemoryManager::MemcpyToHost(), cloudViewer::utility::nullopt, cloudViewer::core::Tensor::NumElements(), and cloudViewer::core::Tensor::To().