eVision Python API
Loading...
Searching...
No Matches
eVision.Segmenters.EGrayscaleSingleThresholdSegmenter Class Reference

Segments an image using a single threshold on a grayscale image. More...

Inheritance diagram for eVision.Segmenters.EGrayscaleSingleThresholdSegmenter:
Collaboration diagram for eVision.Segmenters.EGrayscaleSingleThresholdSegmenter:

Public Member Functions

None Load (self, str path)
 Load the eVision.Segmenters.EGrayscaleSingleThresholdSegmenter configuration.
None Load (self, eVision.ESerializer|None serializer)
 Load the eVision.Segmenters.EGrayscaleSingleThresholdSegmenter configuration.
None Save (self, str path)
 Save the eVision.Segmenters.EGrayscaleSingleThresholdSegmenter configuration.
None Save (self, eVision.ESerializer|None serializer)
 Save the eVision.Segmenters.EGrayscaleSingleThresholdSegmenter configuration.
bool IsFirstApplication (self)
 Checks whether the segmenter has already been used to segment an image.
eVision.EGrayscaleSingleThreshold Mode (self)
 Threshold selection mode.
 Mode (self, eVision.EGrayscaleSingleThreshold value)
 Threshold selection mode.
int AbsoluteThreshold (self)
 Value of the threshold to be used in the case of absolute thresholding.
 AbsoluteThreshold (self, int value)
 Value of the threshold to be used in the case of absolute thresholding.
float RelativeThreshold (self)
 Fraction of the image pixels that belongs to the black layer in the case of relative thresholding.
 RelativeThreshold (self, float value)
 Fraction of the image pixels that belongs to the black layer in the case of relative thresholding.
int LastThreshold (self)
 Retrieves the actual threshold value that was used for the last image that got encoded by the segmenter.
Public Member Functions inherited from eVision.Segmenters.ETwoLayersImageSegmenter
int BlackLayerIndex (self)
 Index of the black layer in the destination coded image.
 BlackLayerIndex (self, int value)
 Index of the black layer in the destination coded image.
bool BlackLayerEncoded (self)
 Black layer encoding status.
 BlackLayerEncoded (self, bool value)
 Black layer encoding status.
int WhiteLayerIndex (self)
 Index of the white layer in the destination coded image.
 WhiteLayerIndex (self, int value)
 Index of the white layer in the destination coded image.
bool WhiteLayerEncoded (self)
 White layer encoding status.
 WhiteLayerEncoded (self, bool value)
 White layer encoding status.

Detailed Description

Segments an image using a single threshold on a grayscale image.

Remarks:

This segmenter is applicable to eVision.EROIBW8 and eVision.EROIBW16 grayscale images. It produces coded images with two layers: the black layer (usually, with index 0) contains the unmasked pixels having a gray value strictly below the threshold value; and the white layer (usually, with index 1) contains the remaining unmasked pixels, i.e. unmasked pixels having a gray value greater or equal to the threshold value. The default thresholding method is minimum residue. If another method is required, the eVision.Segmenters.EGrayscaleSingleThresholdSegmenter.Mode property must be set prior to encoding.

License(s): EasyObject

Member Function Documentation

◆ AbsoluteThreshold() [1/2]

int eVision.Segmenters.EGrayscaleSingleThresholdSegmenter.AbsoluteThreshold ( self)

Value of the threshold to be used in the case of absolute thresholding.

◆ AbsoluteThreshold() [2/2]

eVision.Segmenters.EGrayscaleSingleThresholdSegmenter.AbsoluteThreshold ( self,
int value )

Value of the threshold to be used in the case of absolute thresholding.

◆ IsFirstApplication()

bool eVision.Segmenters.EGrayscaleSingleThresholdSegmenter.IsFirstApplication ( self)

Checks whether the segmenter has already been used to segment an image.

◆ LastThreshold()

int eVision.Segmenters.EGrayscaleSingleThresholdSegmenter.LastThreshold ( self)

Retrieves the actual threshold value that was used for the last image that got encoded by the segmenter.

Remarks:

A call to this method will result in an exception if it is the first time the segmenter is applied. To check whether the segmenter has already been applied, call the eVision.Segmenters.EGrayscaleSingleThresholdSegmenter.IsFirstApplication method.

◆ Load() [1/2]

None eVision.Segmenters.EGrayscaleSingleThresholdSegmenter.Load ( self,
eVision.ESerializer | None serializer )

Load the eVision.Segmenters.EGrayscaleSingleThresholdSegmenter configuration.

The given eVision.ESerializer must have been created for reading.

Parameters
serializerThe serializer.

Reimplemented from eVision.Segmenters.ETwoLayersImageSegmenter.

◆ Load() [2/2]

None eVision.Segmenters.EGrayscaleSingleThresholdSegmenter.Load ( self,
str path )

Load the eVision.Segmenters.EGrayscaleSingleThresholdSegmenter configuration.

The given eVision.ESerializer must have been created for reading.

Parameters
pathThe file path.

Reimplemented from eVision.Segmenters.ETwoLayersImageSegmenter.

◆ Mode() [1/2]

eVision.EGrayscaleSingleThreshold eVision.Segmenters.EGrayscaleSingleThresholdSegmenter.Mode ( self)

Threshold selection mode.

◆ Mode() [2/2]

eVision.Segmenters.EGrayscaleSingleThresholdSegmenter.Mode ( self,
eVision.EGrayscaleSingleThreshold value )

Threshold selection mode.

◆ RelativeThreshold() [1/2]

float eVision.Segmenters.EGrayscaleSingleThresholdSegmenter.RelativeThreshold ( self)

Fraction of the image pixels that belongs to the black layer in the case of relative thresholding.

◆ RelativeThreshold() [2/2]

eVision.Segmenters.EGrayscaleSingleThresholdSegmenter.RelativeThreshold ( self,
float value )

Fraction of the image pixels that belongs to the black layer in the case of relative thresholding.

◆ Save() [1/2]

None eVision.Segmenters.EGrayscaleSingleThresholdSegmenter.Save ( self,
eVision.ESerializer | None serializer )

Save the eVision.Segmenters.EGrayscaleSingleThresholdSegmenter configuration.

The given eVision.ESerializer must have been created for writing.

Parameters
serializerThe serializer.

Reimplemented from eVision.Segmenters.ETwoLayersImageSegmenter.

◆ Save() [2/2]

None eVision.Segmenters.EGrayscaleSingleThresholdSegmenter.Save ( self,
str path )

Save the eVision.Segmenters.EGrayscaleSingleThresholdSegmenter configuration.

The given eVision.ESerializer must have been created for writing.

Parameters
pathThe file path.

Reimplemented from eVision.Segmenters.ETwoLayersImageSegmenter.