eVision Python API
Loading...
Searching...
No Matches
eVision.EImageEncoder Class Reference

This class is responsible for the encoding of an image into an eVision.ECodedImage2 object. More...

Public Member Functions

None __init__ (self)
 Constructs an image encoder.
None __init__ (self, eVision.EImageEncoder other)
 Constructs an image encoder.
None CopyTo (self, eVision.EImageEncoder other)
 Copies the current eVision.EImageEncoder into another.
None Serialize (self, eVision.ESerializer|None serializer)
 Serializes the eVision.EImageEncoder.
None Load (self, str path)
 Loads the eVision.EImageEncoder.
None Load (self, eVision.ESerializer|None serializer)
 Loads the eVision.EImageEncoder.
None Save (self, str path)
 Saves the eVision.EImageEncoder.
None Save (self, eVision.ESerializer|None serializer)
 Saves the eVision.EImageEncoder.
None ResetContinuousMode (self)
 Resets the continuous mode, emptying the internal memory.
None FlushContinuousMode (self, eVision.ECodedImage2 codedImage)
 Resets the continuous mode, emptying the internal memory, after writing the objects that are not yet completed in a coded image.
None Encode (self, eVision.EROIBW8 sourceImage, eVision.ECodedImage2 codedImage)
 Encodes an image or an ROI as a coded image.
None Encode (self, eVision.EROIBW16 sourceImage, eVision.ECodedImage2 codedImage)
 Encodes an image or an ROI as a coded image.
None Encode (self, eVision.EROIC24 sourceImage, eVision.ECodedImage2 codedImage)
 Encodes an image or an ROI as a coded image.
None Encode (self, eVision.EROIBW8 sourceImage, eVision.EROIBW8 inputMask, eVision.ECodedImage2 codedImage)
 Encodes an image or an ROI as a coded image.
None Encode (self, eVision.EROIBW16 sourceImage, eVision.EROIBW8 inputMask, eVision.ECodedImage2 codedImage)
 Encodes an image or an ROI as a coded image.
None Encode (self, eVision.EROIC24 sourceImage, eVision.EROIBW8 inputMask, eVision.ECodedImage2 codedImage)
 Encodes an image or an ROI as a coded image.
None Encode (self, eVision.EROIBW8 sourceImage, eVision.ERegion region, eVision.ECodedImage2 codedImage)
 Encodes an image or an ROI as a coded image.
None Encode (self, eVision.EROIBW16 sourceImage, eVision.ERegion region, eVision.ECodedImage2 codedImage)
 Encodes an image or an ROI as a coded image.
None Encode (self, eVision.EROIC24 sourceImage, eVision.ERegion region, eVision.ECodedImage2 codedImage)
 Encodes an image or an ROI as a coded image.
None Encode (self, eVision.EROIBW8 sourceImage, eVision.EFrame frame, eVision.ECodedImage2 codedImage)
 Encodes an image or an ROI as a coded image.
None Encode (self, eVision.EROIBW16 sourceImage, eVision.EFrame frame, eVision.ECodedImage2 codedImage)
 Encodes an image or an ROI as a coded image.
None Encode (self, eVision.EROIC24 sourceImage, eVision.EFrame frame, eVision.ECodedImage2 codedImage)
 Encodes an image or an ROI as a coded image.
None Encode (self, eVision.EROIBW8 sourceImage, eVision.ERegion region, eVision.EFrame frame, eVision.ECodedImage2 codedImage)
 Encodes an image or an ROI as a coded image.
None Encode (self, eVision.EROIBW16 sourceImage, eVision.ERegion region, eVision.EFrame frame, eVision.ECodedImage2 codedImage)
 Encodes an image or an ROI as a coded image.
None Encode (self, eVision.EROIC24 sourceImage, eVision.ERegion region, eVision.EFrame frame, eVision.ECodedImage2 codedImage)
 Encodes an image or an ROI as a coded image.
eVision.ESegmentationMethod SegmentationMethod (self)
 Segmentation method used during the encoding.
 SegmentationMethod (self, eVision.ESegmentationMethod value)
 Segmentation method used during the encoding.
eVision.Segmenters.EColorRangeThresholdSegmenter ColorRangeThresholdSegmenter (self)
 Returns a reference to the internal instance of the segmenter for color-range thresholding, in order to set its parameters.
eVision.Segmenters.EColorSingleThresholdSegmenter ColorSingleThresholdSegmenter (self)
 Returns a reference to the internal instance of the segmenter for single color thresholding, in order to set its parameters.
eVision.Segmenters.EGrayscaleDoubleThresholdSegmenter GrayscaleDoubleThresholdSegmenter (self)
 Returns a reference to the internal instance of the segmenter for double color thresholding, in order to set its parameters.
eVision.Segmenters.EGrayscaleSingleThresholdSegmenter GrayscaleSingleThresholdSegmenter (self)
 Returns a reference to the internal instance of the segmenter for single grayscale thresholding, in order to set its parameters.
eVision.Segmenters.EImageRangeSegmenter ImageRangeSegmenter (self)
 Returns a reference to the internal instance of the segmenter for pixel-by-pixel, range-based thresholding, in order to set its parameters.
eVision.Segmenters.ELabeledImageSegmenter LabeledImageSegmenter (self)
 Returns a reference to the internal instance of the segmenter that maps the value of the pixels directly to a layer index, in order to set its parameters.
eVision.Segmenters.EReferenceImageSegmenter ReferenceImageSegmenter (self)
 Returns a reference to the internal instance of the segmenter for single pixel-by-pixel thresholding, in order to set its parameters.
eVision.EEncodingConnexity EncodingConnexity (self)
 Connexity mode.
 EncodingConnexity (self, eVision.EEncodingConnexity value)
 Connexity mode.
bool ContinuousModeEnabled (self)
 Continuous mode enabling status.
 ContinuousModeEnabled (self, bool value)
 Continuous mode enabling status.
int ContinuousModeMaxHeight (self)
 Maximum number of rows that are kept in memory in the continuous mode.
 ContinuousModeMaxHeight (self, int value)
 Maximum number of rows that are kept in memory in the continuous mode.

Detailed Description

This class is responsible for the encoding of an image into an eVision.ECodedImage2 object.

Remarks:

This class is responsible for the extraction of the runs in a source image, the aggregation of the runs into objects, as well as the proper handling of the continuous mode. It also provides methods to configure the image segmentation process.

The segmentation process classifies the pixels of the source image according to their value to create a set of layers. In each layer taken separately, the encoding process then assembles the connected pixels to build the coded elements (blobs).

By default, the segmentation method consists of grayscale single thresholding, with automatic threshold selection (as determined by the minimum residue rule).

License(s): EasyObject

Constructor & Destructor Documentation

◆ __init__() [1/2]

None eVision.EImageEncoder.__init__ ( self)

Constructs an image encoder.

◆ __init__() [2/2]

None eVision.EImageEncoder.__init__ ( self,
eVision.EImageEncoder other )

Constructs an image encoder.

Parameters
otherThe other eVision.EImageEncoder that we will copy into this one.

Member Function Documentation

◆ ColorRangeThresholdSegmenter()

eVision.Segmenters.EColorRangeThresholdSegmenter eVision.EImageEncoder.ColorRangeThresholdSegmenter ( self)

Returns a reference to the internal instance of the segmenter for color-range thresholding, in order to set its parameters.

◆ ColorSingleThresholdSegmenter()

eVision.Segmenters.EColorSingleThresholdSegmenter eVision.EImageEncoder.ColorSingleThresholdSegmenter ( self)

Returns a reference to the internal instance of the segmenter for single color thresholding, in order to set its parameters.

◆ ContinuousModeEnabled() [1/2]

bool eVision.EImageEncoder.ContinuousModeEnabled ( self)

Continuous mode enabling status.

Remarks:

In the continuous mode, objects are constructed over a sequence of images: The image encoder encodes only the objects that contain no run touching the last row of the source image. The objects touching the inferior border of the image are not written in the coded image: These objects are indeed expected to continue in the subsequent image chunks. Such objects are kept in memory, and are consumed when analyzing the subsequent images.

◆ ContinuousModeEnabled() [2/2]

eVision.EImageEncoder.ContinuousModeEnabled ( self,
bool value )

Continuous mode enabling status.

Remarks:

In the continuous mode, objects are constructed over a sequence of images: The image encoder encodes only the objects that contain no run touching the last row of the source image. The objects touching the inferior border of the image are not written in the coded image: These objects are indeed expected to continue in the subsequent image chunks. Such objects are kept in memory, and are consumed when analyzing the subsequent images.

◆ ContinuousModeMaxHeight() [1/2]

int eVision.EImageEncoder.ContinuousModeMaxHeight ( self)

Maximum number of rows that are kept in memory in the continuous mode.

Remarks:

This property can be used to put a bound on the size of the internal memory of the image encoder in the continuous mode. If this property is set to zero, then memory can grow arbitrarily (there is no maximum number of rows).

◆ ContinuousModeMaxHeight() [2/2]

eVision.EImageEncoder.ContinuousModeMaxHeight ( self,
int value )

Maximum number of rows that are kept in memory in the continuous mode.

Remarks:

This property can be used to put a bound on the size of the internal memory of the image encoder in the continuous mode. If this property is set to zero, then memory can grow arbitrarily (there is no maximum number of rows).

◆ CopyTo()

None eVision.EImageEncoder.CopyTo ( self,
eVision.EImageEncoder other )

Copies the current eVision.EImageEncoder into another.

Parameters
otherThe other eVision.EImageEncoder that we will copy this one into.

◆ Encode() [1/15]

None eVision.EImageEncoder.Encode ( self,
eVision.EROIBW16 sourceImage,
eVision.ECodedImage2 codedImage )

Encodes an image or an ROI as a coded image.

Remarks:

The previous content of the result coded image is discarded.

Parameters
sourceImageThe input image that is to be encoded.
codedImageThe coded image that will hold the result of the encoding process.

◆ Encode() [2/15]

None eVision.EImageEncoder.Encode ( self,
eVision.EROIBW16 sourceImage,
eVision.EFrame frame,
eVision.ECodedImage2 codedImage )

Encodes an image or an ROI as a coded image.

Remarks:

The previous content of the result coded image is discarded.

Parameters
sourceImageThe input image that is to be encoded.
frameFrame of reference. It is used to compute some features of the coded elements. The region must also be defined in this frame of reference.
codedImageThe coded image that will hold the result of the encoding process.

◆ Encode() [3/15]

None eVision.EImageEncoder.Encode ( self,
eVision.EROIBW16 sourceImage,
eVision.ERegion region,
eVision.ECodedImage2 codedImage )

Encodes an image or an ROI as a coded image.

Remarks:

The previous content of the result coded image is discarded.

Parameters
sourceImageThe input image that is to be encoded.
regionRegion of the input image that is to be encoded.
codedImageThe coded image that will hold the result of the encoding process.

◆ Encode() [4/15]

None eVision.EImageEncoder.Encode ( self,
eVision.EROIBW16 sourceImage,
eVision.ERegion region,
eVision.EFrame frame,
eVision.ECodedImage2 codedImage )

Encodes an image or an ROI as a coded image.

Remarks:

The previous content of the result coded image is discarded.

Parameters
sourceImageThe input image that is to be encoded.
regionRegion of the input image that is to be encoded.
frameFrame of reference. It is used to compute some features of the coded elements. The region must also be defined in this frame of reference.
codedImageThe coded image that will hold the result of the encoding process.

◆ Encode() [5/15]

None eVision.EImageEncoder.Encode ( self,
eVision.EROIBW16 sourceImage,
eVision.EROIBW8 inputMask,
eVision.ECodedImage2 codedImage )

Encodes an image or an ROI as a coded image.

Remarks:

The previous content of the result coded image is discarded.

Parameters
sourceImageThe input image that is to be encoded.
inputMaskThe possible input Flexible Mask that restricts the encoding. The input mask is a grayscale image having the same height and the same width as the source image. Any pixel in the source image that is covered by a value of 0 in the input mask will not get encoded in any layer. Any other pixel value in the input mask causes the pixel to be a candidate for the encoding.
codedImageThe coded image that will hold the result of the encoding process.

◆ Encode() [6/15]

None eVision.EImageEncoder.Encode ( self,
eVision.EROIBW8 sourceImage,
eVision.ECodedImage2 codedImage )

Encodes an image or an ROI as a coded image.

Remarks:

The previous content of the result coded image is discarded.

Parameters
sourceImageThe input image that is to be encoded.
codedImageThe coded image that will hold the result of the encoding process.

◆ Encode() [7/15]

None eVision.EImageEncoder.Encode ( self,
eVision.EROIBW8 sourceImage,
eVision.EFrame frame,
eVision.ECodedImage2 codedImage )

Encodes an image or an ROI as a coded image.

Remarks:

The previous content of the result coded image is discarded.

Parameters
sourceImageThe input image that is to be encoded.
frameFrame of reference. It is used to compute some features of the coded elements. The region must also be defined in this frame of reference.
codedImageThe coded image that will hold the result of the encoding process.

◆ Encode() [8/15]

None eVision.EImageEncoder.Encode ( self,
eVision.EROIBW8 sourceImage,
eVision.ERegion region,
eVision.ECodedImage2 codedImage )

Encodes an image or an ROI as a coded image.

Remarks:

The previous content of the result coded image is discarded.

Parameters
sourceImageThe input image that is to be encoded.
regionRegion of the input image that is to be encoded.
codedImageThe coded image that will hold the result of the encoding process.

◆ Encode() [9/15]

None eVision.EImageEncoder.Encode ( self,
eVision.EROIBW8 sourceImage,
eVision.ERegion region,
eVision.EFrame frame,
eVision.ECodedImage2 codedImage )

Encodes an image or an ROI as a coded image.

Remarks:

The previous content of the result coded image is discarded.

Parameters
sourceImageThe input image that is to be encoded.
regionRegion of the input image that is to be encoded.
frameFrame of reference. It is used to compute some features of the coded elements. The region must also be defined in this frame of reference.
codedImageThe coded image that will hold the result of the encoding process.

◆ Encode() [10/15]

None eVision.EImageEncoder.Encode ( self,
eVision.EROIBW8 sourceImage,
eVision.EROIBW8 inputMask,
eVision.ECodedImage2 codedImage )

Encodes an image or an ROI as a coded image.

Remarks:

The previous content of the result coded image is discarded.

Parameters
sourceImageThe input image that is to be encoded.
inputMaskThe possible input Flexible Mask that restricts the encoding. The input mask is a grayscale image having the same height and the same width as the source image. Any pixel in the source image that is covered by a value of 0 in the input mask will not get encoded in any layer. Any other pixel value in the input mask causes the pixel to be a candidate for the encoding.
codedImageThe coded image that will hold the result of the encoding process.

◆ Encode() [11/15]

None eVision.EImageEncoder.Encode ( self,
eVision.EROIC24 sourceImage,
eVision.ECodedImage2 codedImage )

Encodes an image or an ROI as a coded image.

Remarks:

The previous content of the result coded image is discarded.

Parameters
sourceImageThe input image that is to be encoded.
codedImageThe coded image that will hold the result of the encoding process.

◆ Encode() [12/15]

None eVision.EImageEncoder.Encode ( self,
eVision.EROIC24 sourceImage,
eVision.EFrame frame,
eVision.ECodedImage2 codedImage )

Encodes an image or an ROI as a coded image.

Remarks:

The previous content of the result coded image is discarded.

Parameters
sourceImageThe input image that is to be encoded.
frameFrame of reference. It is used to compute some features of the coded elements. The region must also be defined in this frame of reference.
codedImageThe coded image that will hold the result of the encoding process.

◆ Encode() [13/15]

None eVision.EImageEncoder.Encode ( self,
eVision.EROIC24 sourceImage,
eVision.ERegion region,
eVision.ECodedImage2 codedImage )

Encodes an image or an ROI as a coded image.

Remarks:

The previous content of the result coded image is discarded.

Parameters
sourceImageThe input image that is to be encoded.
regionRegion of the input image that is to be encoded.
codedImageThe coded image that will hold the result of the encoding process.

◆ Encode() [14/15]

None eVision.EImageEncoder.Encode ( self,
eVision.EROIC24 sourceImage,
eVision.ERegion region,
eVision.EFrame frame,
eVision.ECodedImage2 codedImage )

Encodes an image or an ROI as a coded image.

Remarks:

The previous content of the result coded image is discarded.

Parameters
sourceImageThe input image that is to be encoded.
regionRegion of the input image that is to be encoded.
frameFrame of reference. It is used to compute some features of the coded elements. The region must also be defined in this frame of reference.
codedImageThe coded image that will hold the result of the encoding process.

◆ Encode() [15/15]

None eVision.EImageEncoder.Encode ( self,
eVision.EROIC24 sourceImage,
eVision.EROIBW8 inputMask,
eVision.ECodedImage2 codedImage )

Encodes an image or an ROI as a coded image.

Remarks:

The previous content of the result coded image is discarded.

Parameters
sourceImageThe input image that is to be encoded.
inputMaskThe possible input Flexible Mask that restricts the encoding. The input mask is a grayscale image having the same height and the same width as the source image. Any pixel in the source image that is covered by a value of 0 in the input mask will not get encoded in any layer. Any other pixel value in the input mask causes the pixel to be a candidate for the encoding.
codedImageThe coded image that will hold the result of the encoding process.

◆ EncodingConnexity() [1/2]

eVision.EEncodingConnexity eVision.EImageEncoder.EncodingConnexity ( self)

Connexity mode.

Remarks:

The connexity mode specifies the conditions that must hold for neighboring pixels to belong to the same object.

◆ EncodingConnexity() [2/2]

eVision.EImageEncoder.EncodingConnexity ( self,
eVision.EEncodingConnexity value )

Connexity mode.

Remarks:

The connexity mode specifies the conditions that must hold for neighboring pixels to belong to the same object.

◆ FlushContinuousMode()

None eVision.EImageEncoder.FlushContinuousMode ( self,
eVision.ECodedImage2 codedImage )

Resets the continuous mode, emptying the internal memory, after writing the objects that are not yet completed in a coded image.

Parameters
codedImageThe coded image in which the not-yet-completed objects are written.

◆ GrayscaleDoubleThresholdSegmenter()

eVision.Segmenters.EGrayscaleDoubleThresholdSegmenter eVision.EImageEncoder.GrayscaleDoubleThresholdSegmenter ( self)

Returns a reference to the internal instance of the segmenter for double color thresholding, in order to set its parameters.

◆ GrayscaleSingleThresholdSegmenter()

eVision.Segmenters.EGrayscaleSingleThresholdSegmenter eVision.EImageEncoder.GrayscaleSingleThresholdSegmenter ( self)

Returns a reference to the internal instance of the segmenter for single grayscale thresholding, in order to set its parameters.

◆ ImageRangeSegmenter()

eVision.Segmenters.EImageRangeSegmenter eVision.EImageEncoder.ImageRangeSegmenter ( self)

Returns a reference to the internal instance of the segmenter for pixel-by-pixel, range-based thresholding, in order to set its parameters.

◆ LabeledImageSegmenter()

eVision.Segmenters.ELabeledImageSegmenter eVision.EImageEncoder.LabeledImageSegmenter ( self)

Returns a reference to the internal instance of the segmenter that maps the value of the pixels directly to a layer index, in order to set its parameters.

◆ Load() [1/2]

None eVision.EImageEncoder.Load ( self,
eVision.ESerializer | None serializer )

Loads the eVision.EImageEncoder.

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

Parameters
serializerThe serializer.

◆ Load() [2/2]

None eVision.EImageEncoder.Load ( self,
str path )

Loads the eVision.EImageEncoder.

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

Parameters
pathThe file path.

◆ ReferenceImageSegmenter()

eVision.Segmenters.EReferenceImageSegmenter eVision.EImageEncoder.ReferenceImageSegmenter ( self)

Returns a reference to the internal instance of the segmenter for single pixel-by-pixel thresholding, in order to set its parameters.

◆ ResetContinuousMode()

None eVision.EImageEncoder.ResetContinuousMode ( self)

Resets the continuous mode, emptying the internal memory.

◆ Save() [1/2]

None eVision.EImageEncoder.Save ( self,
eVision.ESerializer | None serializer )

Saves the eVision.EImageEncoder.

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

Parameters
serializerThe eVision.ESerializer object that is written to.

◆ Save() [2/2]

None eVision.EImageEncoder.Save ( self,
str path )

Saves the eVision.EImageEncoder.

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

Parameters
pathThe file path.

◆ SegmentationMethod() [1/2]

eVision.ESegmentationMethod eVision.EImageEncoder.SegmentationMethod ( self)

Segmentation method used during the encoding.

◆ SegmentationMethod() [2/2]

eVision.EImageEncoder.SegmentationMethod ( self,
eVision.ESegmentationMethod value )

Segmentation method used during the encoding.

◆ Serialize()

None eVision.EImageEncoder.Serialize ( self,
eVision.ESerializer | None serializer )

Serializes the eVision.EImageEncoder.

Deprecated

Use eVision.EImageEncoder.Save or eVision.EImageEncoder.Load instead.

Deprecated in version 24.10. Scheduled to be removed in version 27.6.

Parameters
serializerSerializer