Open3D
latest (d5167ae)

Getting Started

  • Introduction
  • Getting started
  • Build from source
  • Build C++ projects with Open3D
  • Build documentation
  • ARM support

Tutorial

  • Geometry
  • Pipelines
  • Visualization
  • Tensor
  • Reconstruction system
  • Sensor
  • Reference

Contribute

  • Contributing to Open3D
  • Contribution methods
  • Open3D style guide

C++ API

  • C++ documentation

Python API

  • open3d.camera
  • open3d.core
  • open3d.geometry
  • open3d.io
  • open3d.t
  • open3d.ml
    • tf
      • configs
      • dataloaders
      • datasets
      • layers
      • models
        • BaseModel
        • BatchNormBlock
        • DataProcessing
        • GlobalAverageBlock
        • IdentityBlock
        • KDTree
        • KPConv
        • KPFCNN
        • MaxPoolBlock
        • NearestUpsampleBlock
        • Path
        • RandLANet
        • ResnetBottleneckBlock
        • SimpleBlock
        • UnaryBlock
        • tqdm
        • abspath
        • batch_grid_subsampling
        • batch_ordered_neighbors
        • block_decider
        • build_spatial_hash_table
        • closest_pool
        • confusion_matrix
        • continuous_conv
        • continuous_conv_backprop_filter
        • continuous_conv_transpose
        • continuous_conv_transpose_backprop_filter
        • create_kernel_points
        • dirname
        • exists
        • fixed_radius_search
        • get_bias
        • get_weight
        • global_average
        • grid_subsampling
        • invert_neighbors_list
        • isfile
        • join
        • knn_search
        • makedirs
        • max_pool
        • ordered_neighbors
        • radius_gaussian
        • radius_search
        • reduce_subarrays_sum
        • split
        • tf_batch_neighbors
        • tf_batch_subsampling
        • trans_augment
        • trans_crop_pc
        • trans_normalize
        • voxel_pooling
        • voxel_pooling_grad
      • modules
      • ops
      • pipelines
      • utils
      • vis
    • torch
  • open3d.pipelines
  • open3d.utility
  • open3d.visualization
Open3D
  • Docs »
  • open3d.ml »
  • open3d.ml.tf »
  • open3d.ml.tf.models »
  • open3d.ml.tf.models.radius_search

open3d.ml.tf.models.radius_search¶

open3d.ml.tf.models.radius_search(points, queries, radii, points_row_splits, queries_row_splits, metric='L2', ignore_query_point=False, return_distances=False, normalize_distances=False, name=None)¶

Computes the indices and distances of all neigbours within a radius.

This op computes the neighborhood for each query point and returns the indices of the neighbors and optionally also the distances. Each query point has an individual search radius. Points and queries can be batched with each batch item having an individual number of points and queries. The following example shows a simple search with just a single batch item:

import open3d.ml.tf as ml3d

points = [
    [0.1,0.1,0.1],
    [0.5,0.5,0.5],
    [1.7,1.7,1.7],
    [1.8,1.8,1.8],
    [0.3,2.4,1.4]]

queries = [
    [1.0,1.0,1.0],
    [0.5,2.0,2.0],
    [0.5,2.1,2.2],
]

radii = [1.0,1.0,1.0]

ml3d.ops.radius_search(points, queries, radii,
                       points_row_splits=[0,5],
                       queries_row_splits=[0,3])
# returns neighbors_index      = [1, 4, 4]
#         neighbors_row_splits = [0, 1, 2, 3]
#         neighbors_distance   = []


# or with pytorch
import torch
import open3d.ml.torch as ml3d

points = torch.Tensor([
  [0.1,0.1,0.1],
  [0.5,0.5,0.5],
  [1.7,1.7,1.7],
  [1.8,1.8,1.8],
  [0.3,2.4,1.4]])

queries = torch.Tensor([
    [1.0,1.0,1.0],
    [0.5,2.0,2.0],
    [0.5,2.1,2.1],
])

radii = torch.Tensor([1.0,1.0,1.0])

ml3d.ops.radius_search(points, queries, radii,
                       points_row_splits=torch.LongTensor([0,5]),
                       queries_row_splits=torch.LongTensor([0,3]))
# returns neighbors_index      = [1, 4, 4]
#         neighbors_row_splits = [0, 1, 2, 3]
#         neighbors_distance   = []
Parameters
  • points – A Tensor. Must be one of the following types: float32, float64. The 3D positions of the input points.

  • queries – A Tensor. Must have the same type as points. The 3D positions of the query points.

  • radii – A Tensor. Must have the same type as points. A vector with the individual radii for each query point.

  • points_row_splits – A Tensor of type int64. 1D vector with the row splits information if points is batched. This vector is [0, num_points] if there is only 1 batch item.

  • queries_row_splits – A Tensor of type int64. 1D vector with the row splits information if queries is batched. This vector is [0, num_queries] if there is only 1 batch item.

  • metric – An optional string from: “L1”, “L2”. Defaults to “L2”. Either L1 or L2. Default is L2

  • ignore_query_point – An optional bool. Defaults to False. If true the points that coincide with the center of the search window will be ignored. This excludes the query point if queries and points are the same point cloud.

  • return_distances – An optional bool. Defaults to False. If True the distances for each neighbor will be returned in the output tensor neighbors_distance. If False a zero length Tensor will be returned for neighbors_distances.

  • normalize_distances – An optional bool. Defaults to False. If True the returned distances will be normalized with the radii.

  • name – A name for the operation (optional).

Returns

A tuple of Tensor objects (neighbors_index, neighbors_row_splits, neighbors_distance).

neighbors_index: A Tensor of type int32. The compact list of indices of the neighbors. The

corresponding query point can be inferred from the neighbor_count_row_splits vector.

neighbors_row_splits: A Tensor of type int64. The exclusive prefix sum of the neighbor count for the

query points including the total neighbor count as the last element. The size of this array is the number of queries + 1.

neighbors_distance: A Tensor. Has the same type as points. Stores the distance to each neighbor if return_distances

is True. The distances are squared only if metric is L2. This is a zero length Tensor if return_distances is False.

Next Previous

© Copyright 2018 - 2020, www.open3d.org

Built with Sphinx using a theme provided by Read the Docs.
Docs version latest (d5167ae)
Versions