eVision C++ API 26.10.0-beta.2.dev
Loading...
Searching...
No Matches
eVision::EImageEncoder Class Reference

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

#include <eVision/EasyObject/EasyObject2/EImageEncoder.h>

Collaboration diagram for eVision::EImageEncoder:

Public Member Functions

 EImageEncoder ()
 Constructs an image encoder.
 EImageEncoder (const eVision::EImageEncoder &other)
 Constructs an image encoder.
virtual ~EImageEncoder () throw ()
eVision::EImageEncoder & operator= (const eVision::EImageEncoder &other)
 Assignment operator.
bool operator== (const eVision::EImageEncoder &other) const
 Equality operator.
bool operator!= (const eVision::EImageEncoder &other) const
 Inequality operator.
void CopyTo (eVision::EImageEncoder &other) const
 Copies the current EImageEncoder into another.
virtual void Serialize (eVision::ESerializer *serializer)
 Serializes the EImageEncoder.
virtual void Load (const std::string &path)
 Loads the EImageEncoder. The given ESerializer must have been created for reading.
virtual void Load (eVision::ESerializer *serializer)
 Loads the EImageEncoder. The given ESerializer must have been created for reading.
virtual void Save (const std::string &path)
 Saves the EImageEncoder. The given ESerializer must have been created for writing.
virtual void Save (eVision::ESerializer *serializer)
 Saves the EImageEncoder. The given ESerializer must have been created for writing.
void SetSegmentationMethod (eVision::ESegmentationMethod method)
 Segmentation method used during the encoding.
eVision::ESegmentationMethod GetSegmentationMethod () const
 Segmentation method used during the encoding.
eVision::Segmenters::EColorRangeThresholdSegmenter & GetColorRangeThresholdSegmenter ()
 Returns a reference to the internal instance of the segmenter for color-range thresholding, in order to set its parameters.
eVision::Segmenters::EColorSingleThresholdSegmenter & GetColorSingleThresholdSegmenter ()
 Returns a reference to the internal instance of the segmenter for single color thresholding, in order to set its parameters.
eVision::Segmenters::EGrayscaleDoubleThresholdSegmenter & GetGrayscaleDoubleThresholdSegmenter ()
 Returns a reference to the internal instance of the segmenter for double color thresholding, in order to set its parameters.
eVision::Segmenters::EGrayscaleSingleThresholdSegmenter & GetGrayscaleSingleThresholdSegmenter ()
 Returns a reference to the internal instance of the segmenter for single grayscale thresholding, in order to set its parameters.
eVision::Segmenters::EImageRangeSegmenter & GetImageRangeSegmenter ()
 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 & GetLabeledImageSegmenter ()
 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 & GetReferenceImageSegmenter ()
 Returns a reference to the internal instance of the segmenter for single pixel-by-pixel thresholding, in order to set its parameters.
void SetEncodingConnexity (eVision::EEncodingConnexity connexity)
 Connexity mode.
eVision::EEncodingConnexity GetEncodingConnexity () const
 Connexity mode.
void SetContinuousModeEnabled (bool enabled)
 Continuous mode enabling status.
bool GetContinuousModeEnabled () const
 Continuous mode enabling status.
void SetContinuousModeMaxHeight (unsigned int maxHeight)
 Maximum number of rows that are kept in memory in the continuous mode.
unsigned int GetContinuousModeMaxHeight () const
 Maximum number of rows that are kept in memory in the continuous mode.
void ResetContinuousMode ()
 Resets the continuous mode, emptying the internal memory.
void FlushContinuousMode (eVision::ECodedImage2 &codedImage)
 Resets the continuous mode, emptying the internal memory, after writing the objects that are not yet completed in a coded image.
void Encode (const eVision::EROIBW8 &sourceImage, eVision::ECodedImage2 &codedImage)
 Encodes an image or an ROI as a coded image.
void Encode (const eVision::EROIBW16 &sourceImage, eVision::ECodedImage2 &codedImage)
 Encodes an image or an ROI as a coded image.
void Encode (const eVision::EROIC24 &sourceImage, eVision::ECodedImage2 &codedImage)
 Encodes an image or an ROI as a coded image.
void Encode (const eVision::EROIBW8 &sourceImage, const eVision::EROIBW8 &inputMask, eVision::ECodedImage2 &codedImage)
 Encodes an image or an ROI as a coded image.
void Encode (const eVision::EROIBW16 &sourceImage, const eVision::EROIBW8 &inputMask, eVision::ECodedImage2 &codedImage)
 Encodes an image or an ROI as a coded image.
void Encode (const eVision::EROIC24 &sourceImage, const eVision::EROIBW8 &inputMask, eVision::ECodedImage2 &codedImage)
 Encodes an image or an ROI as a coded image.
void Encode (const eVision::EROIBW8 &sourceImage, const eVision::ERegion &region, eVision::ECodedImage2 &codedImage)
 Encodes an image or an ROI as a coded image.
void Encode (const eVision::EROIBW16 &sourceImage, const eVision::ERegion &region, eVision::ECodedImage2 &codedImage)
 Encodes an image or an ROI as a coded image.
void Encode (const eVision::EROIC24 &sourceImage, const eVision::ERegion &region, eVision::ECodedImage2 &codedImage)
 Encodes an image or an ROI as a coded image.
void Encode (const eVision::EROIBW8 &sourceImage, const eVision::EFrame &frame, eVision::ECodedImage2 &codedImage)
 Encodes an image or an ROI as a coded image.
void Encode (const eVision::EROIBW16 &sourceImage, const eVision::EFrame &frame, eVision::ECodedImage2 &codedImage)
 Encodes an image or an ROI as a coded image.
void Encode (const eVision::EROIC24 &sourceImage, const eVision::EFrame &frame, eVision::ECodedImage2 &codedImage)
 Encodes an image or an ROI as a coded image.
void Encode (const eVision::EROIBW8 &sourceImage, const eVision::ERegion &region, const eVision::EFrame &frame, eVision::ECodedImage2 &codedImage)
 Encodes an image or an ROI as a coded image.
void Encode (const eVision::EROIBW16 &sourceImage, const eVision::ERegion &region, const eVision::EFrame &frame, eVision::ECodedImage2 &codedImage)
 Encodes an image or an ROI as a coded image.
void Encode (const eVision::EROIC24 &sourceImage, const eVision::ERegion &region, const eVision::EFrame &frame, eVision::ECodedImage2 &codedImage)
 Encodes an image or an ROI as a coded image.
 EImageEncoder (CppWrapperInternal::InternalConstructor)

Public Attributes

CppWrapperInternal::WrappedClass wrappedClass_

Detailed Description

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

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

◆ EImageEncoder() [1/3]

eVision::EImageEncoder::EImageEncoder ( )

Constructs an image encoder.

◆ EImageEncoder() [2/3]

eVision::EImageEncoder::EImageEncoder ( const eVision::EImageEncoder & other)

Constructs an image encoder.

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

◆ ~EImageEncoder()

eVision::EImageEncoder::~EImageEncoder ( )
throw ( )
virtual

◆ EImageEncoder() [3/3]

eVision::EImageEncoder::EImageEncoder ( CppWrapperInternal::InternalConstructor )

Member Function Documentation

◆ CopyTo()

void eVision::EImageEncoder::CopyTo ( eVision::EImageEncoder & other) const

Copies the current EImageEncoder into another.

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

◆ Encode() [1/15]

void eVision::EImageEncoder::Encode ( const eVision::EROIBW16 & sourceImage,
const eVision::EFrame & frame,
eVision::ECodedImage2 & codedImage )

Encodes an image or an ROI as a coded image.

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.

The previous content of the result coded image is discarded.

◆ Encode() [2/15]

void eVision::EImageEncoder::Encode ( const eVision::EROIBW16 & sourceImage,
const eVision::ERegion & region,
const eVision::EFrame & frame,
eVision::ECodedImage2 & codedImage )

Encodes an image or an ROI as a coded image.

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.

The previous content of the result coded image is discarded.

◆ Encode() [3/15]

void eVision::EImageEncoder::Encode ( const eVision::EROIBW16 & sourceImage,
const eVision::ERegion & region,
eVision::ECodedImage2 & codedImage )

Encodes an image or an ROI as a coded image.

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.

The previous content of the result coded image is discarded.

◆ Encode() [4/15]

void eVision::EImageEncoder::Encode ( const eVision::EROIBW16 & sourceImage,
const eVision::EROIBW8 & inputMask,
eVision::ECodedImage2 & codedImage )

Encodes an image or an ROI as a coded image.

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.

The previous content of the result coded image is discarded.

◆ Encode() [5/15]

void eVision::EImageEncoder::Encode ( const eVision::EROIBW16 & sourceImage,
eVision::ECodedImage2 & codedImage )

Encodes an image or an ROI as a coded image.

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

The previous content of the result coded image is discarded.

◆ Encode() [6/15]

void eVision::EImageEncoder::Encode ( const eVision::EROIBW8 & sourceImage,
const eVision::EFrame & frame,
eVision::ECodedImage2 & codedImage )

Encodes an image or an ROI as a coded image.

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.

The previous content of the result coded image is discarded.

◆ Encode() [7/15]

void eVision::EImageEncoder::Encode ( const eVision::EROIBW8 & sourceImage,
const eVision::ERegion & region,
const eVision::EFrame & frame,
eVision::ECodedImage2 & codedImage )

Encodes an image or an ROI as a coded image.

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.

The previous content of the result coded image is discarded.

◆ Encode() [8/15]

void eVision::EImageEncoder::Encode ( const eVision::EROIBW8 & sourceImage,
const eVision::ERegion & region,
eVision::ECodedImage2 & codedImage )

Encodes an image or an ROI as a coded image.

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.

The previous content of the result coded image is discarded.

◆ Encode() [9/15]

void eVision::EImageEncoder::Encode ( const eVision::EROIBW8 & sourceImage,
const eVision::EROIBW8 & inputMask,
eVision::ECodedImage2 & codedImage )

Encodes an image or an ROI as a coded image.

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.

The previous content of the result coded image is discarded.

◆ Encode() [10/15]

void eVision::EImageEncoder::Encode ( const eVision::EROIBW8 & sourceImage,
eVision::ECodedImage2 & codedImage )

Encodes an image or an ROI as a coded image.

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

The previous content of the result coded image is discarded.

◆ Encode() [11/15]

void eVision::EImageEncoder::Encode ( const eVision::EROIC24 & sourceImage,
const eVision::EFrame & frame,
eVision::ECodedImage2 & codedImage )

Encodes an image or an ROI as a coded image.

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.

The previous content of the result coded image is discarded.

◆ Encode() [12/15]

void eVision::EImageEncoder::Encode ( const eVision::EROIC24 & sourceImage,
const eVision::ERegion & region,
const eVision::EFrame & frame,
eVision::ECodedImage2 & codedImage )

Encodes an image or an ROI as a coded image.

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.

The previous content of the result coded image is discarded.

◆ Encode() [13/15]

void eVision::EImageEncoder::Encode ( const eVision::EROIC24 & sourceImage,
const eVision::ERegion & region,
eVision::ECodedImage2 & codedImage )

Encodes an image or an ROI as a coded image.

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.

The previous content of the result coded image is discarded.

◆ Encode() [14/15]

void eVision::EImageEncoder::Encode ( const eVision::EROIC24 & sourceImage,
const eVision::EROIBW8 & inputMask,
eVision::ECodedImage2 & codedImage )

Encodes an image or an ROI as a coded image.

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.

The previous content of the result coded image is discarded.

◆ Encode() [15/15]

void eVision::EImageEncoder::Encode ( const eVision::EROIC24 & sourceImage,
eVision::ECodedImage2 & codedImage )

Encodes an image or an ROI as a coded image.

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

The previous content of the result coded image is discarded.

◆ FlushContinuousMode()

void eVision::EImageEncoder::FlushContinuousMode ( 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.

◆ GetColorRangeThresholdSegmenter()

eVision::Segmenters::EColorRangeThresholdSegmenter & eVision::EImageEncoder::GetColorRangeThresholdSegmenter ( )

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

◆ GetColorSingleThresholdSegmenter()

eVision::Segmenters::EColorSingleThresholdSegmenter & eVision::EImageEncoder::GetColorSingleThresholdSegmenter ( )

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

◆ GetContinuousModeEnabled()

bool eVision::EImageEncoder::GetContinuousModeEnabled ( ) const

Continuous mode enabling status.

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.

◆ GetContinuousModeMaxHeight()

unsigned int eVision::EImageEncoder::GetContinuousModeMaxHeight ( ) const

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

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).

◆ GetEncodingConnexity()

eVision::EEncodingConnexity eVision::EImageEncoder::GetEncodingConnexity ( ) const

Connexity mode.

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

◆ GetGrayscaleDoubleThresholdSegmenter()

eVision::Segmenters::EGrayscaleDoubleThresholdSegmenter & eVision::EImageEncoder::GetGrayscaleDoubleThresholdSegmenter ( )

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

◆ GetGrayscaleSingleThresholdSegmenter()

eVision::Segmenters::EGrayscaleSingleThresholdSegmenter & eVision::EImageEncoder::GetGrayscaleSingleThresholdSegmenter ( )

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

◆ GetImageRangeSegmenter()

eVision::Segmenters::EImageRangeSegmenter & eVision::EImageEncoder::GetImageRangeSegmenter ( )

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

◆ GetLabeledImageSegmenter()

eVision::Segmenters::ELabeledImageSegmenter & eVision::EImageEncoder::GetLabeledImageSegmenter ( )

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.

◆ GetReferenceImageSegmenter()

eVision::Segmenters::EReferenceImageSegmenter & eVision::EImageEncoder::GetReferenceImageSegmenter ( )

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

◆ GetSegmentationMethod()

eVision::ESegmentationMethod eVision::EImageEncoder::GetSegmentationMethod ( ) const

Segmentation method used during the encoding.

◆ Load() [1/2]

void eVision::EImageEncoder::Load ( const std::string & path)
virtual

Loads the EImageEncoder. The given ESerializer must have been created for reading.

Parameters
pathThe file path.

◆ Load() [2/2]

void eVision::EImageEncoder::Load ( eVision::ESerializer * serializer)
virtual

Loads the EImageEncoder. The given ESerializer must have been created for reading.

Parameters
serializerThe serializer.

◆ operator!=()

bool eVision::EImageEncoder::operator!= ( const eVision::EImageEncoder & other) const

Inequality operator.

Parameters
otherOther image encoder to compare with

◆ operator=()

eVision::EImageEncoder & eVision::EImageEncoder::operator= ( const eVision::EImageEncoder & other)

Assignment operator.

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

◆ operator==()

bool eVision::EImageEncoder::operator== ( const eVision::EImageEncoder & other) const

Equality operator.

Parameters
otherOther image encoder to compare with

◆ ResetContinuousMode()

void eVision::EImageEncoder::ResetContinuousMode ( )

Resets the continuous mode, emptying the internal memory.

◆ Save() [1/2]

void eVision::EImageEncoder::Save ( const std::string & path)
virtual

Saves the EImageEncoder. The given ESerializer must have been created for writing.

Parameters
pathThe file path.

◆ Save() [2/2]

void eVision::EImageEncoder::Save ( eVision::ESerializer * serializer)
virtual

Saves the EImageEncoder. The given ESerializer must have been created for writing.

Parameters
serializerThe ESerializer object that is written to.

◆ Serialize()

void eVision::EImageEncoder::Serialize ( eVision::ESerializer * serializer)
virtual

Serializes the EImageEncoder.

Parameters
serializerSerializer
Deprecated

Use EImageEncoder::Save or EImageEncoder::Load instead.

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

◆ SetContinuousModeEnabled()

void eVision::EImageEncoder::SetContinuousModeEnabled ( bool enabled)

Continuous mode enabling status.

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.

◆ SetContinuousModeMaxHeight()

void eVision::EImageEncoder::SetContinuousModeMaxHeight ( unsigned int maxHeight)

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

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).

◆ SetEncodingConnexity()

void eVision::EImageEncoder::SetEncodingConnexity ( eVision::EEncodingConnexity connexity)

Connexity mode.

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

◆ SetSegmentationMethod()

void eVision::EImageEncoder::SetSegmentationMethod ( eVision::ESegmentationMethod method)

Segmentation method used during the encoding.

Member Data Documentation

◆ wrappedClass_

CppWrapperInternal::WrappedClass eVision::EImageEncoder::wrappedClass_