Open3D (C++ API)  0.12.0
Data Structures | Functions | Variables
open3d::ml::contrib Namespace Reference

Data Structures

struct  Point
 
struct  PointCloud
 
class  PointXYZ
 
class  SampledData
 

Functions

PointXYZ max_point (std::vector< PointXYZ > points)
 
PointXYZ min_point (std::vector< PointXYZ > points)
 
PointXYZ operator+ (const PointXYZ A, const PointXYZ B)
 
PointXYZ operator- (const PointXYZ A, const PointXYZ B)
 
PointXYZ operator* (const PointXYZ P, const float a)
 
PointXYZ operator* (const float a, const PointXYZ P)
 
std::ostream & operator<< (std::ostream &os, const PointXYZ P)
 
bool operator== (const PointXYZ A, const PointXYZ B)
 
const core::Tensor KnnSearch (const core::Tensor &query_points, const core::Tensor &dataset_points, int knn)
 
const core::Tensor RadiusSearch (const core::Tensor &query_points, const core::Tensor &dataset_points, const core::Tensor &query_batches, const core::Tensor &dataset_batches, double radius)
 
void grid_subsampling (std::vector< PointXYZ > &original_points, std::vector< PointXYZ > &subsampled_points, std::vector< float > &original_features, std::vector< float > &subsampled_features, std::vector< int > &original_classes, std::vector< int > &subsampled_classes, float sampleDl, int verbose)
 
void batch_grid_subsampling (std::vector< PointXYZ > &original_points, std::vector< PointXYZ > &subsampled_points, std::vector< float > &original_features, std::vector< float > &subsampled_features, std::vector< int > &original_classes, std::vector< int > &subsampled_classes, std::vector< int > &original_batches, std::vector< int > &subsampled_batches, float sampleDl, int max_p)
 
void IoUBevCPUKernel (const float *boxes_a, const float *boxes_b, float *iou, int num_a, int num_b)
 
void IoU3dCPUKernel (const float *boxes_a, const float *boxes_b, float *iou, int num_a, int num_b)
 
OPEN3D_HOST_DEVICE float Cross (const Point &a, const Point &b)
 
OPEN3D_HOST_DEVICE float Cross (const Point &p1, const Point &p2, const Point &p0)
 
OPEN3D_HOST_DEVICE int CheckRectCross (const Point &p1, const Point &p2, const Point &q1, const Point &q2)
 
OPEN3D_HOST_DEVICE int CheckInBox2D (const float *box, const Point &p)
 
OPEN3D_HOST_DEVICE int Intersection (const Point &p1, const Point &p0, const Point &q1, const Point &q0, Point &ans)
 
OPEN3D_HOST_DEVICE void RotateAroundCenter (const Point &center, const float angle_cos, const float angle_sin, Point &p)
 
OPEN3D_HOST_DEVICE int PointCmp (const Point &a, const Point &b, const Point &center)
 
OPEN3D_HOST_DEVICE float BoxOverlap (const float *box_a, const float *box_b)
 
OPEN3D_HOST_DEVICE float IoUBev2DWithMinAndMax (const float *box_a, const float *box_b, bool intersection_only=false)
 (x_min, z_min, x_max, z_max, y_rotate) More...
 
OPEN3D_HOST_DEVICE float IoUBev2DWithCenterAndSize (const float *box_a, const float *box_b, bool intersection_only=false)
 (x_center, z_center, x_size, z_size, y_rotate) More...
 
OPEN3D_HOST_DEVICE float IoU3DWithCenterAndSize (const float *box_a, const float *box_b)
 (x_center, y_max, z_center, x_size, y_size, z_size, y_rotate) More...
 
void brute_neighbors (std::vector< PointXYZ > &queries, std::vector< PointXYZ > &supports, std::vector< int > &neighbors_indices, float radius, int verbose)
 
void ordered_neighbors (std::vector< PointXYZ > &queries, std::vector< PointXYZ > &supports, std::vector< int > &neighbors_indices, float radius)
 
void batch_nanoflann_neighbors (std::vector< PointXYZ > &queries, std::vector< PointXYZ > &supports, std::vector< int > &q_batches, std::vector< int > &s_batches, std::vector< int > &neighbors_indices, float radius)
 
std::vector< int64_t > NmsCPUKernel (const float *boxes, const float *scores, int n, double nms_overlap_thresh)
 

Variables

constexpr int NMS_BLOCK_SIZE = sizeof(uint64_t) * 8
 
constexpr float EPS = static_cast<float>(1e-8)
 

Function Documentation

◆ batch_grid_subsampling()

void open3d::ml::contrib::batch_grid_subsampling ( std::vector< PointXYZ > &  original_points,
std::vector< PointXYZ > &  subsampled_points,
std::vector< float > &  original_features,
std::vector< float > &  subsampled_features,
std::vector< int > &  original_classes,
std::vector< int > &  subsampled_classes,
std::vector< int > &  original_batches,
std::vector< int > &  subsampled_batches,
float  sampleDl,
int  max_p 
)

◆ batch_nanoflann_neighbors()

void open3d::ml::contrib::batch_nanoflann_neighbors ( std::vector< PointXYZ > &  queries,
std::vector< PointXYZ > &  supports,
std::vector< int > &  q_batches,
std::vector< int > &  s_batches,
std::vector< int > &  neighbors_indices,
float  radius 
)

TOOD: This is a temporary function for 3DML repositiory use. In the future, the native Open3D Python API should be improved and used.

Nearest neighbours withing a radius with batching. queries and supports are sliced with their respective batch elements. Uses nanoflann to build a KDTree and find neighbors.

◆ BoxOverlap()

OPEN3D_HOST_DEVICE float open3d::ml::contrib::BoxOverlap ( const float *  box_a,
const float *  box_b 
)
inline

◆ brute_neighbors()

void open3d::ml::contrib::brute_neighbors ( std::vector< PointXYZ > &  queries,
std::vector< PointXYZ > &  supports,
std::vector< int > &  neighbors_indices,
float  radius,
int  verbose 
)

◆ CheckInBox2D()

OPEN3D_HOST_DEVICE int open3d::ml::contrib::CheckInBox2D ( const float *  box,
const Point p 
)
inline

◆ CheckRectCross()

OPEN3D_HOST_DEVICE int open3d::ml::contrib::CheckRectCross ( const Point p1,
const Point p2,
const Point q1,
const Point q2 
)
inline

◆ Cross() [1/2]

OPEN3D_HOST_DEVICE float open3d::ml::contrib::Cross ( const Point a,
const Point b 
)
inline

◆ Cross() [2/2]

OPEN3D_HOST_DEVICE float open3d::ml::contrib::Cross ( const Point p1,
const Point p2,
const Point p0 
)
inline

◆ grid_subsampling()

void open3d::ml::contrib::grid_subsampling ( std::vector< PointXYZ > &  original_points,
std::vector< PointXYZ > &  subsampled_points,
std::vector< float > &  original_features,
std::vector< float > &  subsampled_features,
std::vector< int > &  original_classes,
std::vector< int > &  subsampled_classes,
float  sampleDl,
int  verbose 
)

◆ Intersection()

OPEN3D_HOST_DEVICE int open3d::ml::contrib::Intersection ( const Point p1,
const Point p0,
const Point q1,
const Point q0,
Point ans 
)
inline

◆ IoU3dCPUKernel()

void open3d::ml::contrib::IoU3dCPUKernel ( const float *  boxes_a,
const float *  boxes_b,
float *  iou,
int  num_a,
int  num_b 
)
Parameters
boxes_a(num_a, 7) float32.
boxes_b(num_b, 7) float32.
iou(num_a, num_b) float32, output iou values.
num_aNumber of boxes in boxes_a.
num_bNumber of boxes in boxes_b.

◆ IoU3DWithCenterAndSize()

OPEN3D_HOST_DEVICE float open3d::ml::contrib::IoU3DWithCenterAndSize ( const float *  box_a,
const float *  box_b 
)
inline

(x_center, y_max, z_center, x_size, y_size, z_size, y_rotate)

◆ IoUBev2DWithCenterAndSize()

OPEN3D_HOST_DEVICE float open3d::ml::contrib::IoUBev2DWithCenterAndSize ( const float *  box_a,
const float *  box_b,
bool  intersection_only = false 
)
inline

(x_center, z_center, x_size, z_size, y_rotate)

◆ IoUBev2DWithMinAndMax()

OPEN3D_HOST_DEVICE float open3d::ml::contrib::IoUBev2DWithMinAndMax ( const float *  box_a,
const float *  box_b,
bool  intersection_only = false 
)
inline

(x_min, z_min, x_max, z_max, y_rotate)

◆ IoUBevCPUKernel()

void open3d::ml::contrib::IoUBevCPUKernel ( const float *  boxes_a,
const float *  boxes_b,
float *  iou,
int  num_a,
int  num_b 
)
Parameters
boxes_a(num_a, 5) float32.
boxes_b(num_b, 5) float32.
iou(num_a, num_b) float32, output iou values.
num_aNumber of boxes in boxes_a.
num_bNumber of boxes in boxes_b.
intersection_onlyIf true returns intersection, else returns intersection over union.

◆ KnnSearch()

const core::Tensor open3d::ml::contrib::KnnSearch ( const core::Tensor query_points,
const core::Tensor dataset_points,
int  knn 
)

TOOD: This is a temporary wrapper for 3DML repository use. In the future, the native Open3D Python API should be improved and used.

Parameters
query_pointsTensor of shape {n_query_points, d}, dtype Float32.
dataset_pointsTensor of shape {n_dataset_points, d}, dtype Float32.
knnInt.
Returns
Tensor of shape (n_query_points, knn), dtype Int32.

TOOD: This is a temory wrapper for 3DML repositiory use. In the future, the native Open3D Python API should be improved and used.

Parameters
query_pointsTensor of shape {n_query_points, d}, dtype Float32.
dataset_pointsTensor of shape {n_dataset_points, d}, dtype Float32.
knnInt.
Returns
Tensor of shape (n_query_points, knn), dtype Int32.

◆ max_point()

PointXYZ open3d::ml::contrib::max_point ( std::vector< PointXYZ points)

◆ min_point()

PointXYZ open3d::ml::contrib::min_point ( std::vector< PointXYZ points)

◆ NmsCPUKernel()

std::vector< int64_t > open3d::ml::contrib::NmsCPUKernel ( const float *  boxes,
const float *  scores,
int  n,
double  nms_overlap_thresh 
)
Parameters
boxes(n, 5) float32.
scores(n,) float32.
nNumber of boxes.
nms_overlap_threshWhen a high-score box is selected, other remaining boxes with IoU > nms_overlap_thresh will be discarded.
Returns
Selected box indices to keep.

◆ operator*() [1/2]

PointXYZ open3d::ml::contrib::operator* ( const PointXYZ  P,
const float  a 
)
inline

◆ operator*() [2/2]

PointXYZ open3d::ml::contrib::operator* ( const float  a,
const PointXYZ  P 
)
inline

◆ operator+()

PointXYZ open3d::ml::contrib::operator+ ( const PointXYZ  A,
const PointXYZ  B 
)
inline

◆ operator-()

PointXYZ open3d::ml::contrib::operator- ( const PointXYZ  A,
const PointXYZ  B 
)
inline

◆ operator<<()

std::ostream& open3d::ml::contrib::operator<< ( std::ostream &  os,
const PointXYZ  P 
)
inline

◆ operator==()

bool open3d::ml::contrib::operator== ( const PointXYZ  A,
const PointXYZ  B 
)
inline

◆ ordered_neighbors()

void open3d::ml::contrib::ordered_neighbors ( std::vector< PointXYZ > &  queries,
std::vector< PointXYZ > &  supports,
std::vector< int > &  neighbors_indices,
float  radius 
)

TOOD: This is a temporary function for 3DML repositiory use. In the future, the native Open3D Python API should be improved and used.

Nearest neighbours within a given radius. For each query point, finds a set of neighbor indices whose distance is less than given radius. Modifies the neighbors_indices inplace.

◆ PointCmp()

OPEN3D_HOST_DEVICE int open3d::ml::contrib::PointCmp ( const Point a,
const Point b,
const Point center 
)
inline

◆ RadiusSearch()

const core::Tensor open3d::ml::contrib::RadiusSearch ( const core::Tensor query_points,
const core::Tensor dataset_points,
const core::Tensor query_batches,
const core::Tensor dataset_batches,
double  radius 
)

TOOD: This is a temporary wrapper for 3DML repository use. In the future, the native Open3D Python API should be improved and used.

Parameters
query_pointsTensor of shape {n_query_points, d}, dtype Float32.
dataset_pointsTensor of shape {n_dataset_points, d}, dtype Float32.
query_batchesTensor of shape {n_batches,}, dtype Int32. It is required that sum(query_batches) == n_query_points.
dataset_batchesTensor of shape {n_batches,}, dtype Int32. It is required that that sum(dataset_batches) == n_dataset_points.
radiusThe radius to search.
Returns
Tensor of shape {n_query_points, max_neighbor}, dtype Int32, where max_neighbor is the maximum number neighbor of neighbors for all query points. For query points with less than max_neighbor neighbors, the neighbor index will be padded by -1.

TOOD: This is a temory wrapper for 3DML repositiory use. In the future, the native Open3D Python API should be improved and used.

Parameters
query_pointsTensor of shape {n_query_points, d}, dtype Float32.
dataset_pointsTensor of shape {n_dataset_points, d}, dtype Float32.
query_batchesTensor of shape {n_batches,}, dtype Int32. It is required that sum(query_batches) == n_query_points.
dataset_batchesTensor of shape {n_batches,}, dtype Int32. It is required that that sum(dataset_batches) == n_dataset_points.
radiusThe radius to search.
Returns
Tensor of shape {n_query_points, max_neighbor}, dtype Int32, where max_neighbor is the maximum number neighbor of neighbors for all query points. For query points with less than max_neighbor neighbors, the neighbor index will be padded by -1.

◆ RotateAroundCenter()

OPEN3D_HOST_DEVICE void open3d::ml::contrib::RotateAroundCenter ( const Point center,
const float  angle_cos,
const float  angle_sin,
Point p 
)
inline

Variable Documentation

◆ EPS

constexpr float open3d::ml::contrib::EPS = static_cast<float>(1e-8)

◆ NMS_BLOCK_SIZE

constexpr int open3d::ml::contrib::NMS_BLOCK_SIZE = sizeof(uint64_t) * 8