XYZFilterCallbackΒΆ

XYZFilterCallback will be invoked in XYZCreate to remove unwanted data points.

idx = XYZFilterCallback(rvX, rvY, rvZ)

Return Value

idx is a vector with indices. Only the data points rvX[idx], rvY[idx], rvZ[idx] are used to create the dataset. If idx[1] equals 0 the dataset will not be created.

Parameters

rvX

rvX is a vector with x-coordinates.

rvY

rvY is a vector with y-coordinates.

rvZ

rvZ is a vector with z-coordinates.

Comment

This is the standard implementation of the function.

100 by 100 bins are used. For each bin the median value (center value) will be returned. reduce3d is called twice. The second time the number of bins is specified as a negative number. This will move the bins by half of the bin width. This avoids problems with points that are close to the bin border in neighboring bins.

def XYZFilterCallback(x, y, z)
{
    idx = reduce3d(x, y, z, 100, "median");
    idx2 = reduce3d(x[idx], y[idx], z[idx], -100, "median");
    return idx[idx2];
}

Example

Siehe reduce3d.

History

Version Description
5.10.2 New.

id-153479