ImageDev

Feret2d

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

The two-dimensional measurements of the Feret category are customizable with the following methods.

Syntax

Method Description
void setOrientationCount( uint64_t number ) Sets the number of Feret angles and updates the angle distribution.
uint64_t orientationCount() const Returns the number of Feret angles.
void setOrientation( uint64_t index, float angle ) Sets a new angle in degrees, between 0 and 360, at the index position of the Feret distribution.
float orientation( uint64_t index ) Returns the angle value in degrees at the index position in the distribution.
void resample() Recomputes the orientations from the current number of angles in order to have a uniform distribution around a half circle.

Feret2d::Ptr feret2d = MeasurementAttributes::feret2d();
feret2d->setOrientationCount( 5 );
int orientationNumberValue = feret2d->orientationCount();
feret2d->setOrientation( 4, 30 );
float orientationValue = feret2d->orientation( 4 );
feret2d->resample();
orientationValue =feret2d->orientation( 4 );
        
Method Description
set_orientation(self, index, angle) Sets a new angle in degrees, between 0 and 360, at the index position of the Feret distribution.
orientation(self, index) Returns the angle value in degrees at the index position in the distribution.
resample(self) Recomputes the orientations from the current number of angles in order to have a uniform distribution around a half circle.
Attributes Description
orientation_count Returns the number of Feret angles or sets it and updates the angle distribution.

feret2d = imagedev.MeasurementAttributes.feret2d
feret2d.orientation_count = 10
orientation_number_value = feret2d.orientation_count
feret2d.set_orientation(9, 0.25)
orientation_value = feret2d.orientation(9)
feret2d.resample()
orientation_value = feret2d.orientation(9)
        
Method Description
void SetOrientation(long index, float angle) Sets a new angle in degrees, between 0 and 360, at the index position of the Feret distribution.
float Orientation(long index) Returns the angle value in degrees at the index position in the distribution.
void Resample() Recomputes the orientations from the current number of angles in order to have a uniform distribution around a half circle.
Attributes Description
orientationCount Sets or gets the number of Feret angles and updates the angle distribution.

Feret2d feret2d = MeasurementAttributes.feret2d();
feret2d.orientationCount=5;
auto orientationNumberValue = feret2d.orientationCount;
feret2d.SetOrientation(4, 30);
auto orientationValue = feret2d.Orientation(4);
feret2d.Resample();
auto orientationValue = feret2d.Orientation(4);