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 $\theta$ angle lying in [0; 90] and a $\phi$ 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 );
        
Method Description
set_orientation(self, index, 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.
orientation(self, index) Returns the theta and phi angles, in degrees, at the index position of the distribution in a two-elements array.
resample(self) 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.
Attributes Description
orientation_count Returns or sets the number of Feret angle pairs of the distribution.

feret3d = imagedev.MeasurementAttributes.feret3d
feret3d.orientation_count = 27
orientation_count_value = feret3d.orientation_count
feret3d.set_orientation(26, [27, 66])
orientation_value = feret3d.orientation(26)
feret3d.resample()
orientation_value = feret3d.orientation(26)
        
Method Description
void SetOrientation(long index, float[] 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.
float[] Orientation(long 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.
Attributes Description
orientationCount Gets or sets the number of Feret angle pairs and updates the distribution.

Feret3d feret3d = MeasurementAttributes.feret3d();
feret3d.orientationCount = 6;
auto orientationNumberValue = feret3d.orientationCount;
feret3d.SetOrientation(5, 30, 45);
auto orientation = feret3d.Orientation(5);
feret3d.Resample();
orientation = feret3d.Orientation(5);