Processing math: 100%
ImageDev

Feret3d

This attribute manages three-dimensional measurements belonging to the Feret category of native measurements.

The three-dimensional measurements of the Feret category are customizable with the methods below.
A 3D Feret orientation is defined by a θ angle lying in [0; 90] and a ϕ angle lying in ]-180; 180].

Syntax

Method Description
void setOrientationCount( uint64_t number ) Sets the number of Feret angle pairs and updates the distribution.
uint64_t orientationCount() const Returns the number of Feret angle pairs of the distribution.
void setOrientation( uint64_t index, iolink::Vector2f angles ) Sets a pair of theta and phi angles, in degrees, at the index position of the Feret distribution.The angle parameter must be an array of two elements. The first represents theta between 0 and 90; the second represents phi between -180 and 180.
iolink::Vector2f orientation( uint64_t index ) Returns the theta and phi angles, in degrees, at the index position of the distribution in a two-elements array.
void resample() Recomputes the orientations from the current number of angles in order to have a uniform distribution around a half sphere. The initial number of Feret orientations can be rounded to a greater value when this value exceeds 100.

Feret3d::Ptr feret3d = MeasurementAttributes::feret3d();
feret3d->setOrientationCount( 6 );
int orientationNumberValue = feret3d->orientationCount();
iolink::Vector2f orientation;
orientation[0] = 30;
orientation[1] = 45;
feret3d->setOrientation( 5, orientation );
iolink::Vector2f orientationValue = feret3d->orientation( 5 );
feret3d->resample();
orientationValue = feret3d->orientation( 5 );