Modifier and Type | Field and Description |
---|---|
private PointCloud_KdTree |
N |
Constructor and Description |
---|
MedianWithSorting(PointCloud_KdTree points) |
Modifier and Type | Method and Description |
---|---|
Point_d |
findMedian(int cutDim)
Compute the median of a set of point cloud (after sorting)
cutDim = {0,1,2} => {x,y,z}
Warning: input points should not be sorted (perform a copy of input points)
|
private Point_d |
selectWithSorting(Point_d[] buffer,
int index,
int cutDim)
Sort the input array and select the i-th element
Remark: it takes O(nlog n) time
|
private final PointCloud_KdTree N
public MedianWithSorting(PointCloud_KdTree points)
private Point_d selectWithSorting(Point_d[] buffer, int index, int cutDim)
buffer
- array of input pointsindex
- rank of the element to returncutDim
- indicates which are the coordinates to comparepublic Point_d findMedian(int cutDim)
findMedian
in interface Median
cutDim
- defines the cut direction, {0,1,2} => {x,y,z}