Size Calculation by Center-to-Line Distance

Description

This operator calculates the length and width of a bounding box using geometric methods.

Its core logic is:

  1. First, calculate a center point based on a given main point cloud.

  2. Then, calculate the perpendicular distances from this center point to four input lines.

  3. Finally, the operator assumes these four lines form the four sides of a rectangle and calculates the length and width of the rectangle by summing the opposing distances (i.e., summing the two largest distances and summing the two smallest distances).

Overview

Calculates the length and width dimensions of the bounding box through the distance from the point cloud center to four fitted lines.

Scenarios

Mainly used in scenarios where the bounding box calculated by the bounding box algorithm has deviations, to obtain more precise bounding box side lengths.

Inputs and Outputs

Inputs

Point Cloud: The input point cloud used to calculate the center point. Only one point cloud is required. It can be the merged result of fitted lines or the original point cloud before fitting.

Line equation parameter list: A list of line equation parameters. Each element contains the parameters of one fitted line: a point on the line and its direction vector [point.x point.y point.z direction.x direction.y direction.z].

Line point cloud: Line point clouds consisting of four point clouds, each representing one of the four fitted lines. Used as an auxiliary input when calculating height using the triangle area-perimeter method.

Outputs

Bounding Box Size: Outputs a list containing two elements [Size 1, Size 2], representing the calculated length and width of the bounding box.

Parameters

Center Point Type

Description

Defines the method used to compute the center point from the input "point cloud".

Tuning Instructions

  • Point Cloud Mean: Averages the 3D coordinates of all points in the point cloud to obtain the center point. This method is fast and suits scenarios where the point cloud distribution is fairly even with little noise.

  • Point Cloud Median: Takes the median of the 3D coordinates of all points in the point cloud to obtain the center point. This method is less sensitive to outliers or sparse noise, and is more robust when the point cloud contains anomalous points that could affect the mean calculation.

Parameter Range

Values/Range:

  • Point Cloud Mean

  • Point Cloud Median

Default: Point Cloud Mean

Distance Calculation Method

Description

Defines the mathematical method used to compute the distance from the center point to each line.

Tuning Instructions

  • Point-to-Line Distance: Uses the standard 3D point-to-line distance formula. This is more accurate when using the input "line equation parameter list" and is the preferred choice under normal circumstances, but it depends on the accuracy of the line fitting.

  • Triangle Area/Perimeter Height Calculation: This method requires "line point cloud" as input. It forms a triangle from the center point and the two endpoints of the actual point cloud on each line, then uses Heron’s formula to compute the triangle’s area and base length, and back-calculates the height of the triangle as the point-to-line distance. Try this method when the line equation is not very accurate, or when the distance between the two line points is short.

Parameter Range

Values/Range:

  • Distance from Point to Line

  • Calculate Height via Triangle Area and Perimeter

Default: Distance from Point to Line