Open3D (C++ API)
0.11.0
|
A pointcloud contains a set of 3D points. More...
#include <PointCloud.h>
Public Member Functions | |
PointCloud (core::Dtype dtype=core::Dtype::Float32, const core::Device &device=core::Device("CPU:0")) | |
Construct an empty pointcloud. More... | |
PointCloud (const core::TensorList &points) | |
PointCloud (const std::unordered_map< std::string, core::TensorList > &map_keys_to_tensorlists) | |
virtual | ~PointCloud () override |
const TensorListMap & | GetPointAttrPybind () const |
Getter for point_attr_ TensorListMap. Used in Pybind. More... | |
void | SetPointAttrPybind (const TensorListMap &point_attr) |
Setter for point_attr_ TensorListMap. Used in Pybind. More... | |
core::TensorList & | GetPointAttr (const std::string &key) |
core::TensorList & | GetPoints () |
Get the value of the "points" attribute. Convenience function. More... | |
core::TensorList & | GetPointColors () |
Get the value of the "colors" attribute. Convenience function. More... | |
core::TensorList & | GetPointNormals () |
Get the value of the "normals" attribute. Convenience function. More... | |
const core::TensorList & | GetPointAttr (const std::string &key) const |
const core::TensorList & | GetPoints () const |
Get the value of the "points" attribute. Convenience function. More... | |
const core::TensorList & | GetPointColors () const |
Get the value of the "colors" attribute. Convenience function. More... | |
const core::TensorList & | GetPointNormals () const |
Get the value of the "normals" attribute. Convenience function. More... | |
void | SetPointAttr (const std::string &key, const core::TensorList &value) |
void | SetPoints (const core::TensorList &value) |
Set the value of the "points" attribute. Convenience function. More... | |
void | SetPointColors (const core::TensorList &value) |
Set the value of the "colors" attribute. Convenience function. More... | |
void | SetPointNormals (const core::TensorList &value) |
Set the value of the "normals" attribute. Convenience function. More... | |
bool | HasPointAttr (const std::string &key) const |
bool | HasPoints () const |
bool | HasPointColors () const |
bool | HasPointNormals () const |
void | SynchronizedPushBack (const std::unordered_map< std::string, core::Tensor > &map_keys_to_tensors) |
PointCloud & | Clear () override |
Clear all data in the pointcloud. More... | |
bool | IsEmpty () const override |
Returns !HasPoints(). More... | |
core::Tensor | GetMinBound () const |
Returns the min bound for point coordinates. More... | |
core::Tensor | GetMaxBound () const |
Returns the max bound for point coordinates. More... | |
core::Tensor | GetCenter () const |
Returns the center for point coordinates. More... | |
PointCloud & | Transform (const core::Tensor &transformation) |
Transforms the points and normals (if exist). More... | |
PointCloud & | Translate (const core::Tensor &translation, bool relative=true) |
Translates points. More... | |
PointCloud & | Scale (double scale, const core::Tensor ¢er) |
Scale points. More... | |
PointCloud & | Rotate (const core::Tensor &R, const core::Tensor ¢er) |
Rotate points and normals (if exist). More... | |
core::Device | GetDevice () const |
open3d::geometry::PointCloud | ToLegacyPointCloud () const |
Convert to a legacy Open3D PointCloud. More... | |
Public Member Functions inherited from open3d::t::geometry::Geometry | |
virtual | ~Geometry () |
GeometryType | GetGeometryType () const |
Returns one of registered geometry types. More... | |
int | Dimension () const |
Returns whether the geometry is 2D or 3D. More... | |
Static Public Member Functions | |
static geometry::PointCloud | FromLegacyPointCloud (const open3d::geometry::PointCloud &pcd_legacy, core::Dtype dtype=core::Dtype::Float32, const core::Device &device=core::Device("CPU:0")) |
Create a PointCloud from a legacy Open3D PointCloud. More... | |
Protected Attributes | |
core::Device | device_ = core::Device("CPU:0") |
TensorListMap | point_attr_ |
Additional Inherited Members | |
Public Types inherited from open3d::t::geometry::Geometry | |
enum | GeometryType { GeometryType::Unspecified = 0, GeometryType::PointCloud = 1, GeometryType::VoxelGrid = 2, GeometryType::Octree = 3, GeometryType::LineSet = 4, GeometryType::MeshBase = 5, GeometryType::TriangleMesh = 6, GeometryType::HalfEdgeTriangleMesh = 7, GeometryType::Image = 8, GeometryType::RGBDImage = 9, GeometryType::TetraMesh = 10, GeometryType::OrientedBoundingBox = 11, GeometryType::AxisAlignedBoundingBox = 12 } |
Specifies possible geometry types. More... | |
Protected Member Functions inherited from open3d::t::geometry::Geometry | |
Geometry (GeometryType type, int dimension) | |
Parameterized Constructor. More... | |
A pointcloud contains a set of 3D points.
The PointCloud class stores the attribute data in key-value pairs for flexibility, where the key is a string representing the attribute name and value is a TensorList containing the attribute data. In most cases, the length of an attribute should be equal to the length of the "points", the pointcloud class provides helper functions to check and facilitates this consistency.
Although the attributes are all stored in a key-value pair dictionary, the attributes have different levels:
Note that the level 0 and level 1 convenience functions can also be achieved via the generalized helper functions:
open3d::t::geometry::PointCloud::PointCloud | ( | core::Dtype | dtype = core::Dtype::Float32 , |
const core::Device & | device = core::Device("CPU:0") |
||
) |
Construct an empty pointcloud.
open3d::t::geometry::PointCloud::PointCloud | ( | const core::TensorList & | points | ) |
Construct a pointcloud from points.
points | A tensorlist with element shape (3,).
|
open3d::t::geometry::PointCloud::PointCloud | ( | const std::unordered_map< std::string, core::TensorList > & | map_keys_to_tensorlists | ) |
Construct from points and other attributes of the points.
map_keys_to_tensorlists | A map of string to TensorList containing points and their attributes. point_dict must contain at least the "points" key. |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Clear all data in the pointcloud.
Implements open3d::t::geometry::Geometry.
|
static |
Create a PointCloud from a legacy Open3D PointCloud.
core::Tensor open3d::t::geometry::PointCloud::GetCenter | ( | ) | const |
Returns the center for point coordinates.
|
inline |
core::Tensor open3d::t::geometry::PointCloud::GetMaxBound | ( | ) | const |
Returns the max bound for point coordinates.
core::Tensor open3d::t::geometry::PointCloud::GetMinBound | ( | ) | const |
Returns the min bound for point coordinates.
|
inline |
Get attributes. Throws exception if the attribute does not exist.
key | Attribute name. |
|
inline |
Get attributes. Throws exception if the attribute does not exist.
key | Attribute name. |
|
inline |
Getter for point_attr_ TensorListMap. Used in Pybind.
|
inline |
Get the value of the "colors" attribute. Convenience function.
|
inline |
Get the value of the "colors" attribute. Convenience function.
|
inline |
Get the value of the "normals" attribute. Convenience function.
|
inline |
Get the value of the "normals" attribute. Convenience function.
|
inline |
Get the value of the "points" attribute. Convenience function.
|
inline |
Get the value of the "points" attribute. Convenience function.
|
inline |
Returns true if all of the followings are true: 1) attribute key exist 2) attribute's length as points' length 3) attribute's length > 0
|
inline |
Returns true if all of the followings are true: 1) attribute "colors" exist 2) attribute "colors"'s length as points' length 3) attribute "colors"'s length > 0 This is a convenience function.
|
inline |
Returns true if all of the followings are true: 1) attribute "normals" exist 2) attribute "normals"'s length as points' length 3) attribute "normals"'s length > 0 This is a convenience function.
|
inline |
Check if the "points" attribute's value has length > 0. This is a convenience function.
|
inlineoverridevirtual |
Returns !HasPoints().
Implements open3d::t::geometry::Geometry.
PointCloud & open3d::t::geometry::PointCloud::Rotate | ( | const core::Tensor & | R, |
const core::Tensor & | center | ||
) |
Rotate points and normals (if exist).
PointCloud & open3d::t::geometry::PointCloud::Scale | ( | double | scale, |
const core::Tensor & | center | ||
) |
Scale points.
|
inline |
Set attributes. If the attribute key already exists, its value will be overwritten, otherwise, the new key will be created.
key | Attribute name. |
value | A tensorlist. |
|
inline |
Setter for point_attr_ TensorListMap. Used in Pybind.
|
inline |
Set the value of the "colors" attribute. Convenience function.
|
inline |
Set the value of the "normals" attribute. Convenience function.
|
inline |
Set the value of the "points" attribute. Convenience function.
|
inline |
Synchronized push back, data will be copied. Before push back, all existing tensorlists must have the same length.
map_keys_to_tensors | The keys and values to be pushed back. It must contain the same keys and each corresponding tensor must have the same dtype and device. |
open3d::geometry::PointCloud open3d::t::geometry::PointCloud::ToLegacyPointCloud | ( | ) | const |
Convert to a legacy Open3D PointCloud.
PointCloud & open3d::t::geometry::PointCloud::Transform | ( | const core::Tensor & | transformation | ) |
Transforms the points and normals (if exist).
PointCloud & open3d::t::geometry::PointCloud::Translate | ( | const core::Tensor & | translation, |
bool | relative = true |
||
) |
Translates points.
|
protected |
|
protected |