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

An EDataAugmentation object is responsible for storing the data augmentation parameters and generating new transformed images from existing ones. Deep learning algorithms are not invariant to the location, scale, or rotation of the elements of interest in the image. Thus, if the final application requires the deep learning algorithm to be invariant to those characteristics, the dataset must contain images covering the spectrum of those characteristics. More...

#include <eVision/EasyDeepLearning/EDataAugmentation.h>

Collaboration diagram for eVision::EasyDeepLearning::EDataAugmentation:

Public Member Functions

 EDataAugmentation ()
 Creates an EDataAugmentation object.
 EDataAugmentation (const eVision::EasyDeepLearning::EDataAugmentation &other)
 Creates a copy of the EDataAugmentation object other.
virtual ~EDataAugmentation () throw ()
eVision::EasyDeepLearning::EDataAugmentation & operator= (const eVision::EasyDeepLearning::EDataAugmentation &other)
 Copies the EDataAugmentation object other to this object.
bool operator== (const eVision::EasyDeepLearning::EDataAugmentation &other) const
 Equality operator.
void CopyTo (eVision::EasyDeepLearning::EDataAugmentation &other) const
 Copies itself to the EDataAugmentation object other.
void Load (const std::string &path)
 Loads an EDataAugmentation object. The given ESerializer must have been created for reading.
void Load (eVision::ESerializer *serializer)
 Loads an EDataAugmentation object. The given ESerializer must have been created for reading.
void Save (const std::string &path)
 Saves an EDataAugmentation object. The given ESerializer must have been created for writing.
void Save (eVision::ESerializer *serializer)
 Saves an EDataAugmentation object. The given ESerializer must have been created for writing.
bool HasDataAugmentations () const
 Whether the EDataAugmentation object contains augmentations.
void SetMaxHorizontalShift (int32_t maxShift)
 Sets the maximum horizontal shift allowed.
int32_t GetMaxHorizontalShift () const
 Return the maximum horizontal shift allowed.
void SetMaxVerticalShift (int32_t maxShift)
 Sets the maximum vertical shift allowed.
int32_t GetMaxVerticalShift () const
 Return the maximum vertical shift allowed.
void SetMaxRotationAngle (float maxAngle)
 Set the maximum rotation angle allowed. Its value must be between 0 and 180 degrees.
float GetMaxRotationAngle () const
 Returns the maximum rotation angle allowed. The unit of the returned angle is in the current angle unit (see Easy::SetAngleUnit).
void SetEnableVerticalFlip (bool enable)
 Sets whether to use vertically flipped versions of input images.
bool GetEnableVerticalFlip () const
 Gets whether to use vertically flipped versions of input images.
void SetEnableHorizontalFlip (bool enable)
 Sets whether to use horizontally flipped versions of input images.
bool GetEnableHorizontalFlip () const
 Gets whether to use horizontally flipped versions of input images.
void SetMinScale (float minScale)
 Sets the minimum scaling allowed. Its value must be strictly positive and below EDataAugmentation::SetMaxScale.
float GetMinScale () const
 Gets the minimum scaling allowed.
void SetMaxScale (float maxScale)
 Sets the maximum scaling allowed. Its value must be strictly positive and over EDataAugmentation::SetMinScale.
float GetMaxScale () const
 Gets the maximum scaling allowed.
void SetMaxHorizontalShear (float hShear)
 Sets the maximum absolute horizontal shear, represented as an angle from the vertical direction. Its value must be between 0 and 90 degrees.
float GetMaxHorizontalShear () const
 Gets the maximum absolute horizontal shear, represented as an angle from the vertical direction.
void SetMaxVerticalShear (float vShear)
 Sets the maximum absolute vertical shear, represented as an angle from the horizontal direction. Its value must be between 0 and 90 degrees.
float GetMaxVerticalShear () const
 Gets the maximum absolute vertical shear, represented as an angle from the horizontal direction.
void SetMaxBrightnessOffset (float offset)
 Sets the maximum absolute brightness offset. It must be between 0 and 1.
float GetMaxBrightnessOffset () const
 Gets the maximum absolute brightness offset.
void SetMaxContrastGain (float val)
 Sets the maximum contrast gain. Its value must be strictly positive and over EDataAugmentation::SetMinContrastGain.
float GetMaxContrastGain () const
 Gets the maximum contrast gain.
void SetMinContrastGain (float val)
 Sets the minimum contrast gain. Its value must be strictly positive and below EDataAugmentation::SetMaxContrastGain.
float GetMinContrastGain () const
 Gets the minimum contrast gain.
void SetMinGamma (float gamma)
 Sets the minimum gamma for gamma correction. Its value must be strictly positive and below EDataAugmentation::SetMaxGamma.
float GetMinGamma () const
 Gets the minimum gamma for gamma correction.
void SetMaxGamma (float gamma)
 Sets the maximum gamma for gamma correction. Its value must be higher than EDataAugmentation::SetMinGamma.
float GetMaxGamma () const
 Gets the maximum gamma for gamma correction.
void SetMaxHueOffset (float hueOffset)
 Sets the maximum absolute hue offset. Its value must be between 0 and 180 degrees.
float GetMaxHueOffset () const
 Gets the maximum absolute hue offset.
void SetMinSaturationGain (float saturationGain)
 Sets the minimum saturation gain. Its value must be strictly positive.
float GetMinSaturationGain () const
 Gets the minimum saturation gain.
void SetMaxSaturationGain (float saturationGain)
 Sets the maximum saturation gain. Its value must be over or equal to EDataAugmentation::SetMinSaturationGain.
float GetMaxSaturationGain () const
 Gets the maximum saturation gain.
void SetGaussianNoiseMaximumStandardDeviation (float gaussianMaximumDeviation)
 The Gaussian noise maximum standard deviation.
float GetGaussianNoiseMaximumStandardDeviation () const
 The Gaussian noise maximum standard deviation.
void SetGaussianNoiseMinimumStandardDeviation (float gaussianMinimumDeviation)
 The Gaussian noise minimum standard deviation.
float GetGaussianNoiseMinimumStandardDeviation () const
 The Gaussian noise minimum standard deviation.
void SetSpeckleNoiseMaximumStandardDeviation (float speckleNoiseMaximumStandardDeviation)
 The speckle noise maximum standard deviation.
float GetSpeckleNoiseMaximumStandardDeviation () const
 The speckle noise maximum standard deviation.
void SetSpeckleNoiseMinimumStandardDeviation (float speckleNoiseMinimumStandardDeviation)
 The speckle noise minimum standard deviation.
float GetSpeckleNoiseMinimumStandardDeviation () const
 The speckle noise minimum standard deviation.
void SetSaltAndPepperNoiseMaximumDensity (float saltAndPepperNoiseMaximumDensity)
 The maximum density of the salt and pepper noise.
float GetSaltAndPepperNoiseMaximumDensity () const
 The maximum density of the salt and pepper noise.
void SetSaltAndPepperNoiseMinimumDensity (float saltAndPepperNoiseMinimumDensity)
 The minimum density of the salt and pepper noise.
float GetSaltAndPepperNoiseMinimumDensity () const
 The minimum density of the salt and pepper noise.
void SetStainDisruptionMaxAnchorPoints (uint32_t stainDisruptioMaxAnchorPoints)
 The maximum number of anchor points to use while disrupting the ellipse.
uint32_t GetStainDisruptionMaxAnchorPoints ()
 The maximum number of anchor points to use while disrupting the ellipse.
void SetStainDisruptionMaxIntensity (float stainDisruptionMaxIntensity)
 The maximum offset applied to the coordinates (x,y) of a pixel from the ellipse contour.
float GetStainDisruptionMaxIntensity ()
 The maximum offset applied to the coordinates (x,y) of a pixel from the ellipse contour.
void SetStainEllipseMinRadius (uint32_t stainEllipseMinRadius)
 The minimum radius of the ellipse used to produce the stain.
uint32_t GetStainEllipseMinRadius ()
 The minimum radius of the ellipse used to produce the stain.
void SetStainEllipseMaxRadius (uint32_t stainEllipseMaxRadius)
 The maximum radius of the ellipse used to produce the stain.
uint32_t GetStainEllipseMaxRadius ()
 The maximum radius of the ellipse used to produce the stain.
void SetMinStainColor (uint8_t minStainColor)
 The minimum color value from which to draw a color to fill in the stain (we use a gaussian distribution of with a mean between EDataAugmentation::SetMinStainColor and EDataAugmentation::SetMaxStainColor).
uint8_t GetMinStainColor ()
 The minimum color value from which to draw a color to fill in the stain (we use a gaussian distribution of with a mean between EDataAugmentation::SetMinStainColor and EDataAugmentation::SetMaxStainColor).
void SetMaxStainColor (uint8_t maxStainColor)
 The maximum color value from which to draw a color to fill in the stain (we use a gaussian distribution of with a mean between EDataAugmentation::SetMinStainColor and EDataAugmentation::SetMaxStainColor).
uint8_t GetMaxStainColor ()
 The maximum color value from which to draw a color to fill in the stain (we use a gaussian distribution of with a mean between EDataAugmentation::SetMinStainColor and EDataAugmentation::SetMaxStainColor).
void SetStainColorVariation (uint32_t stainColorVariation)
 The variation of the color used to fill in the ellipse (We use an gaussian distribution of standard mean deviation stainColorVariation).
uint32_t GetStainColorVariation ()
 The variation of the color used to fill in the ellipse (We use an gaussian distribution of standard mean deviation stainColorVariation).
void SetStainInterpolationSiteFactor (float interpolationSiteFactor)
 The factor to compute the number of interpolation sites to use from the number of anchor points.
float GetStainInterpolationSiteFactor ()
 The factor to compute the number of interpolation sites to use from the number of anchor points.
void SetStainProbability (float stainProbability)
 Probability of applying the stain data augmentation (default value: 0, i.e. no stain).
float GetStainProbability ()
 Probability of applying the stain data augmentation (default value: 0, i.e. no stain).
void SetStainBlur (int blur)
 Stain blur.
int GetStainBlur () const
 Stain blur.
std::unique_ptr< eVision::EBaseROI > Generate (const eVision::EBaseROI *img, eVision::EasyDeepLearning::EDLDataAugmentationType type) const
 Generates a new image from a generic EBaseROI image. The caller is responsible for calling freeing the memory of the returned image by calling delete on the image.
std::unique_ptr< eVision::EBaseROI > Generate (const eVision::EBaseROI *img) const
 Generates a new image from a generic EBaseROI image. The caller is responsible for calling freeing the memory of the returned image by calling delete on the image.
void Generate (const eVision::EROIBW8 &source, eVision::EROIBW8 &dest, eVision::EasyDeepLearning::EDLDataAugmentationType type) const
 Generates a new image.
void Generate (const eVision::EROIBW8 &source, eVision::EROIBW8 &dest) const
 Generates a new image.
void Generate (const eVision::EROIBW16 &source, eVision::EROIBW16 &dest, eVision::EasyDeepLearning::EDLDataAugmentationType type) const
 Generates a new image.
void Generate (const eVision::EROIBW16 &source, eVision::EROIBW16 &dest) const
 Generates a new image.
void Generate (const eVision::EROIC24 &source, eVision::EROIC24 &dest, eVision::EasyDeepLearning::EDLDataAugmentationType type) const
 Generates a new image.
void Generate (const eVision::EROIC24 &source, eVision::EROIC24 &dest) const
 Generates a new image.
 EDataAugmentation (CppWrapperInternal::InternalConstructor)

Public Attributes

CppWrapperInternal::WrappedClass wrappedClass_

Detailed Description

An EDataAugmentation object is responsible for storing the data augmentation parameters and generating new transformed images from existing ones. Deep learning algorithms are not invariant to the location, scale, or rotation of the elements of interest in the image. Thus, if the final application requires the deep learning algorithm to be invariant to those characteristics, the dataset must contain images covering the spectrum of those characteristics.

Data augmentation can be used to avoid capturing in the original dataset the whole spectrum of those characteristics by automatically generating new versions of the images in the dataset that are shifted, scaled or rotated to cover this spectrum.

When generating a new image, the EDataAugmentation will randomly pick transformation value within the specified limits.

When using data augmentation, one must carefully chose the spectrum of transformations such that the element of interest are still visible in the image.

License(s): EasyClassify or EasySegment or EasyLocate

Constructor & Destructor Documentation

◆ EDataAugmentation() [1/3]

eVision::EasyDeepLearning::EDataAugmentation::EDataAugmentation ( )

Creates an EDataAugmentation object.

◆ EDataAugmentation() [2/3]

eVision::EasyDeepLearning::EDataAugmentation::EDataAugmentation ( const eVision::EasyDeepLearning::EDataAugmentation & other)

Creates a copy of the EDataAugmentation object other.

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

◆ ~EDataAugmentation()

eVision::EasyDeepLearning::EDataAugmentation::~EDataAugmentation ( )
throw ( )
virtual

◆ EDataAugmentation() [3/3]

eVision::EasyDeepLearning::EDataAugmentation::EDataAugmentation ( CppWrapperInternal::InternalConstructor )

Member Function Documentation

◆ CopyTo()

void eVision::EasyDeepLearning::EDataAugmentation::CopyTo ( eVision::EasyDeepLearning::EDataAugmentation & other) const

Copies itself to the EDataAugmentation object other.

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

◆ Generate() [1/8]

std::unique_ptr< eVision::EBaseROI > eVision::EasyDeepLearning::EDataAugmentation::Generate ( const eVision::EBaseROI * img) const

Generates a new image from a generic EBaseROI image. The caller is responsible for calling freeing the memory of the returned image by calling delete on the image.

Parameters
imgThe image to transform.

If the data augmentation fails, the method will throw an exception.

◆ Generate() [2/8]

std::unique_ptr< eVision::EBaseROI > eVision::EasyDeepLearning::EDataAugmentation::Generate ( const eVision::EBaseROI * img,
eVision::EasyDeepLearning::EDLDataAugmentationType type ) const

Generates a new image from a generic EBaseROI image. The caller is responsible for calling freeing the memory of the returned image by calling delete on the image.

Parameters
imgThe image to transform.
typeThe type of transformation to generate.

If the data augmentation fails, the method will throw an exception.

◆ Generate() [3/8]

void eVision::EasyDeepLearning::EDataAugmentation::Generate ( const eVision::EROIBW16 & source,
eVision::EROIBW16 & dest ) const

Generates a new image.

Parameters
sourceThe image to transform.
destThe transformed image.

If the data augmentation fails, the method will throw an exception.

◆ Generate() [4/8]

void eVision::EasyDeepLearning::EDataAugmentation::Generate ( const eVision::EROIBW16 & source,
eVision::EROIBW16 & dest,
eVision::EasyDeepLearning::EDLDataAugmentationType type ) const

Generates a new image.

Parameters
sourceThe image to transform.
destThe transformed image.
typeThe type of transformation to generate.

If the data augmentation fails, the method will throw an exception.

◆ Generate() [5/8]

void eVision::EasyDeepLearning::EDataAugmentation::Generate ( const eVision::EROIBW8 & source,
eVision::EROIBW8 & dest ) const

Generates a new image.

Parameters
sourceThe image to transform.
destThe transformed image.

If the data augmentation fails, the method will throw an exception.

◆ Generate() [6/8]

void eVision::EasyDeepLearning::EDataAugmentation::Generate ( const eVision::EROIBW8 & source,
eVision::EROIBW8 & dest,
eVision::EasyDeepLearning::EDLDataAugmentationType type ) const

Generates a new image.

Parameters
sourceThe image to transform.
destThe transformed image.
typeThe type of transformation to generate.

If the data augmentation fails, the method will throw an exception.

◆ Generate() [7/8]

void eVision::EasyDeepLearning::EDataAugmentation::Generate ( const eVision::EROIC24 & source,
eVision::EROIC24 & dest ) const

Generates a new image.

Parameters
sourceThe image to transform.
destThe transformed image.

If the data augmentation fails, the method will throw an exception.

◆ Generate() [8/8]

void eVision::EasyDeepLearning::EDataAugmentation::Generate ( const eVision::EROIC24 & source,
eVision::EROIC24 & dest,
eVision::EasyDeepLearning::EDLDataAugmentationType type ) const

Generates a new image.

Parameters
sourceThe image to transform.
destThe transformed image.
typeThe type of transformation to generate.

If the data augmentation fails, the method will throw an exception.

◆ GetEnableHorizontalFlip()

bool eVision::EasyDeepLearning::EDataAugmentation::GetEnableHorizontalFlip ( ) const

Gets whether to use horizontally flipped versions of input images.

◆ GetEnableVerticalFlip()

bool eVision::EasyDeepLearning::EDataAugmentation::GetEnableVerticalFlip ( ) const

Gets whether to use vertically flipped versions of input images.

◆ GetGaussianNoiseMaximumStandardDeviation()

float eVision::EasyDeepLearning::EDataAugmentation::GetGaussianNoiseMaximumStandardDeviation ( ) const

The Gaussian noise maximum standard deviation.

The Gaussian noise is an additive noise sampled from a Gaussian distribution of deviation between EDataAugmentation::SetGaussianNoiseMinimumStandardDeviation and EDataAugmentation::SetGaussianNoiseMaximumStandardDeviation.(also called the normal distribution).

Its value must be superior or equal to EDataAugmentation::SetGaussianNoiseMinimumStandardDeviation.

This noise is computed before the salt and paper noise.

◆ GetGaussianNoiseMinimumStandardDeviation()

float eVision::EasyDeepLearning::EDataAugmentation::GetGaussianNoiseMinimumStandardDeviation ( ) const

The Gaussian noise minimum standard deviation.

The Gaussian noise is an additive noise sampled from a Gaussian distribution of deviation between EDataAugmentation::SetGaussianNoiseMinimumStandardDeviation and EDataAugmentation::SetGaussianNoiseMaximumStandardDeviation.(also called the normal distribution).

Its value must be between 0 and EDataAugmentation::SetGaussianNoiseMaximumStandardDeviation.

This noise is computed before the salt and paper noise.

◆ GetMaxBrightnessOffset()

float eVision::EasyDeepLearning::EDataAugmentation::GetMaxBrightnessOffset ( ) const

Gets the maximum absolute brightness offset.

◆ GetMaxContrastGain()

float eVision::EasyDeepLearning::EDataAugmentation::GetMaxContrastGain ( ) const

Gets the maximum contrast gain.

Contrast transformation is performed by multiplying each mean-centered pixel value by a gain value taken between EDataAugmentation::SetMinContrastGain and EDataAugmentation::SetMaxContrastGain. A contrast transformation does not change the overall brightness of an image.

◆ GetMaxGamma()

float eVision::EasyDeepLearning::EDataAugmentation::GetMaxGamma ( ) const

Gets the maximum gamma for gamma correction.

Gamma correction transformation is performed by raising each normalized pixel value to the power of gamma with gamma taken between EDataAugmentation::SetMinGamma and EDataAugmentation::SetMaxGamma.

◆ GetMaxHorizontalShear()

float eVision::EasyDeepLearning::EDataAugmentation::GetMaxHorizontalShear ( ) const

Gets the maximum absolute horizontal shear, represented as an angle from the vertical direction.

◆ GetMaxHorizontalShift()

int32_t eVision::EasyDeepLearning::EDataAugmentation::GetMaxHorizontalShift ( ) const

Return the maximum horizontal shift allowed.

◆ GetMaxHueOffset()

float eVision::EasyDeepLearning::EDataAugmentation::GetMaxHueOffset ( ) const

Gets the maximum absolute hue offset.

◆ GetMaxRotationAngle()

float eVision::EasyDeepLearning::EDataAugmentation::GetMaxRotationAngle ( ) const

Returns the maximum rotation angle allowed. The unit of the returned angle is in the current angle unit (see Easy::SetAngleUnit).

◆ GetMaxSaturationGain()

float eVision::EasyDeepLearning::EDataAugmentation::GetMaxSaturationGain ( ) const

Gets the maximum saturation gain.

◆ GetMaxScale()

float eVision::EasyDeepLearning::EDataAugmentation::GetMaxScale ( ) const

Gets the maximum scaling allowed.

◆ GetMaxStainColor()

uint8_t eVision::EasyDeepLearning::EDataAugmentation::GetMaxStainColor ( )

The maximum color value from which to draw a color to fill in the stain (we use a gaussian distribution of with a mean between EDataAugmentation::SetMinStainColor and EDataAugmentation::SetMaxStainColor).

Its value must be bigger than EDataAugmentation::SetMinStainColor.

◆ GetMaxVerticalShear()

float eVision::EasyDeepLearning::EDataAugmentation::GetMaxVerticalShear ( ) const

Gets the maximum absolute vertical shear, represented as an angle from the horizontal direction.

◆ GetMaxVerticalShift()

int32_t eVision::EasyDeepLearning::EDataAugmentation::GetMaxVerticalShift ( ) const

Return the maximum vertical shift allowed.

◆ GetMinContrastGain()

float eVision::EasyDeepLearning::EDataAugmentation::GetMinContrastGain ( ) const

Gets the minimum contrast gain.

Contrast transformation is performed by multiplying each mean-centered pixel value by a gain value taken between EDataAugmentation::SetMinContrastGain and EDataAugmentation::SetMaxContrastGain. A contrast transformation does not change the overall brightness of an image.

◆ GetMinGamma()

float eVision::EasyDeepLearning::EDataAugmentation::GetMinGamma ( ) const

Gets the minimum gamma for gamma correction.

Gamma correction transformation is performed by raising each normalized pixel value to the power of gamma with gamma taken between EDataAugmentation::SetMinGamma and EDataAugmentation::SetMaxGamma.

◆ GetMinSaturationGain()

float eVision::EasyDeepLearning::EDataAugmentation::GetMinSaturationGain ( ) const

Gets the minimum saturation gain.

◆ GetMinScale()

float eVision::EasyDeepLearning::EDataAugmentation::GetMinScale ( ) const

Gets the minimum scaling allowed.

◆ GetMinStainColor()

uint8_t eVision::EasyDeepLearning::EDataAugmentation::GetMinStainColor ( )

The minimum color value from which to draw a color to fill in the stain (we use a gaussian distribution of with a mean between EDataAugmentation::SetMinStainColor and EDataAugmentation::SetMaxStainColor).

Its value must be inferior to 255 and EDataAugmentation::SetMaxStainColor.

◆ GetSaltAndPepperNoiseMaximumDensity()

float eVision::EasyDeepLearning::EDataAugmentation::GetSaltAndPepperNoiseMaximumDensity ( ) const

The maximum density of the salt and pepper noise.

The salt and pepper noise sets the value of a number of randomly selected (between EDataAugmentation::SetSaltAndPepperNoiseMinimumDensity and EDataAugmentation::SetSaltAndPepperNoiseMaximumDensity) pixels to its minimum or maximum value.

Its value must be between EDataAugmentation::SetSaltAndPepperNoiseMinimumDensity and 1.

This noise is computed after all the other noises.

◆ GetSaltAndPepperNoiseMinimumDensity()

float eVision::EasyDeepLearning::EDataAugmentation::GetSaltAndPepperNoiseMinimumDensity ( ) const

The minimum density of the salt and pepper noise.

The salt and pepper noise sets the value of a number of randomly selected (between EDataAugmentation::SetSaltAndPepperNoiseMinimumDensity and EDataAugmentation::SetSaltAndPepperNoiseMaximumDensity) pixels to its minimum or maximum value.

Its value must be between 0 and EDataAugmentation::SetSaltAndPepperNoiseMinimumDensity.

This noise is computed after all the other noises.

◆ GetSpeckleNoiseMaximumStandardDeviation()

float eVision::EasyDeepLearning::EDataAugmentation::GetSpeckleNoiseMaximumStandardDeviation ( ) const

The speckle noise maximum standard deviation.

The speckle noise is a multiplicative noise sampled from a Gamma distribution of deviation between EDataAugmentation::SetSpeckleNoiseMinimumStandardDeviation and EDataAugmentation::SetSpeckleNoiseMaximumStandardDeviation.

Its value must be strictly higher than EDataAugmentation::SetSpeckleNoiseMinimumStandardDeviation.

This noise is computed before the salt and paper noise.

◆ GetSpeckleNoiseMinimumStandardDeviation()

float eVision::EasyDeepLearning::EDataAugmentation::GetSpeckleNoiseMinimumStandardDeviation ( ) const

The speckle noise minimum standard deviation.

The speckle noise is a multiplicative noise sampled from a Gamma distribution of deviation between EDataAugmentation::SetSpeckleNoiseMinimumStandardDeviation and EDataAugmentation::SetSpeckleNoiseMaximumStandardDeviation.

Its value must be strictly positive and lower than EDataAugmentation::SetSpeckleNoiseMaximumStandardDeviation.

This noise is computed before the salt and paper noise.

◆ GetStainBlur()

int eVision::EasyDeepLearning::EDataAugmentation::GetStainBlur ( ) const

Stain blur.

The stain blur is the half kernel size of a Gaussian filter that is applied on the stain to smooth its edges and therefore the transition between the original image and the stain.

◆ GetStainColorVariation()

uint32_t eVision::EasyDeepLearning::EDataAugmentation::GetStainColorVariation ( )

The variation of the color used to fill in the ellipse (We use an gaussian distribution of standard mean deviation stainColorVariation).

◆ GetStainDisruptionMaxAnchorPoints()

uint32_t eVision::EasyDeepLearning::EDataAugmentation::GetStainDisruptionMaxAnchorPoints ( )

The maximum number of anchor points to use while disrupting the ellipse.

◆ GetStainDisruptionMaxIntensity()

float eVision::EasyDeepLearning::EDataAugmentation::GetStainDisruptionMaxIntensity ( )

The maximum offset applied to the coordinates (x,y) of a pixel from the ellipse contour.

◆ GetStainEllipseMaxRadius()

uint32_t eVision::EasyDeepLearning::EDataAugmentation::GetStainEllipseMaxRadius ( )

The maximum radius of the ellipse used to produce the stain.

Its value must be superior to EDataAugmentation::SetStainEllipseMinRadius.

◆ GetStainEllipseMinRadius()

uint32_t eVision::EasyDeepLearning::EDataAugmentation::GetStainEllipseMinRadius ( )

The minimum radius of the ellipse used to produce the stain.

Its value must be inferior to EDataAugmentation::SetStainEllipseMaxRadius.

◆ GetStainInterpolationSiteFactor()

float eVision::EasyDeepLearning::EDataAugmentation::GetStainInterpolationSiteFactor ( )

The factor to compute the number of interpolation sites to use from the number of anchor points.

◆ GetStainProbability()

float eVision::EasyDeepLearning::EDataAugmentation::GetStainProbability ( )

Probability of applying the stain data augmentation (default value: 0, i.e. no stain).

◆ HasDataAugmentations()

bool eVision::EasyDeepLearning::EDataAugmentation::HasDataAugmentations ( ) const

Whether the EDataAugmentation object contains augmentations.

◆ Load() [1/2]

void eVision::EasyDeepLearning::EDataAugmentation::Load ( const std::string & path)

Loads an EDataAugmentation object. The given ESerializer must have been created for reading.

Parameters
pathThe file path.

◆ Load() [2/2]

void eVision::EasyDeepLearning::EDataAugmentation::Load ( eVision::ESerializer * serializer)

Loads an EDataAugmentation object. The given ESerializer must have been created for reading.

Parameters
serializerThe serializer.

◆ operator=()

eVision::EasyDeepLearning::EDataAugmentation & eVision::EasyDeepLearning::EDataAugmentation::operator= ( const eVision::EasyDeepLearning::EDataAugmentation & other)

Copies the EDataAugmentation object other to this object.

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

◆ operator==()

bool eVision::EasyDeepLearning::EDataAugmentation::operator== ( const eVision::EasyDeepLearning::EDataAugmentation & other) const

Equality operator.

Parameters
otherOther object to compare to

◆ Save() [1/2]

void eVision::EasyDeepLearning::EDataAugmentation::Save ( const std::string & path)

Saves an EDataAugmentation object. The given ESerializer must have been created for writing.

Parameters
pathThe file path.

◆ Save() [2/2]

void eVision::EasyDeepLearning::EDataAugmentation::Save ( eVision::ESerializer * serializer)

Saves an EDataAugmentation object. The given ESerializer must have been created for writing.

Parameters
serializerThe ESerializer object that is written to.

◆ SetEnableHorizontalFlip()

void eVision::EasyDeepLearning::EDataAugmentation::SetEnableHorizontalFlip ( bool enable)

Sets whether to use horizontally flipped versions of input images.

Parameters
enableWhether to enable horizontal flips.

◆ SetEnableVerticalFlip()

void eVision::EasyDeepLearning::EDataAugmentation::SetEnableVerticalFlip ( bool enable)

Sets whether to use vertically flipped versions of input images.

Parameters
enableWhether to enable vertical flips.

◆ SetGaussianNoiseMaximumStandardDeviation()

void eVision::EasyDeepLearning::EDataAugmentation::SetGaussianNoiseMaximumStandardDeviation ( float gaussianMaximumDeviation)

The Gaussian noise maximum standard deviation.

The Gaussian noise is an additive noise sampled from a Gaussian distribution of deviation between EDataAugmentation::SetGaussianNoiseMinimumStandardDeviation and EDataAugmentation::SetGaussianNoiseMaximumStandardDeviation.(also called the normal distribution).

Its value must be superior or equal to EDataAugmentation::SetGaussianNoiseMinimumStandardDeviation.

Parameters
gaussianMaximumDeviationThe maximum standard deviation of the gaussian distribution expressed in percentage of the image type max intensity

This noise is computed before the salt and paper noise.

◆ SetGaussianNoiseMinimumStandardDeviation()

void eVision::EasyDeepLearning::EDataAugmentation::SetGaussianNoiseMinimumStandardDeviation ( float gaussianMinimumDeviation)

The Gaussian noise minimum standard deviation.

The Gaussian noise is an additive noise sampled from a Gaussian distribution of deviation between EDataAugmentation::SetGaussianNoiseMinimumStandardDeviation and EDataAugmentation::SetGaussianNoiseMaximumStandardDeviation.(also called the normal distribution).

Its value must be between 0 and EDataAugmentation::SetGaussianNoiseMaximumStandardDeviation.

Parameters
gaussianMinimumDeviationThe minimum standard deviation of the gaussian distribution expressed in percentage of the image type max intensity

This noise is computed before the salt and paper noise.

◆ SetMaxBrightnessOffset()

void eVision::EasyDeepLearning::EDataAugmentation::SetMaxBrightnessOffset ( float offset)

Sets the maximum absolute brightness offset. It must be between 0 and 1.

Parameters
offsetThe maximum absolute offset to the brightness

Brightness transformation is performed by adding a value taken between -EDataAugmentation::SetMaxBrightnessOffset and +EDataAugmentation::SetMaxBrightnessOffset to each pixel of the normalized image.

◆ SetMaxContrastGain()

void eVision::EasyDeepLearning::EDataAugmentation::SetMaxContrastGain ( float val)

Sets the maximum contrast gain. Its value must be strictly positive and over EDataAugmentation::SetMinContrastGain.

Parameters
valThe maximum contrast gain

Contrast transformation is performed by multiplying each mean-centered pixel value by a gain value taken between EDataAugmentation::SetMinContrastGain and EDataAugmentation::SetMaxContrastGain. A contrast transformation does not change the overall brightness of an image.

◆ SetMaxGamma()

void eVision::EasyDeepLearning::EDataAugmentation::SetMaxGamma ( float gamma)

Sets the maximum gamma for gamma correction. Its value must be higher than EDataAugmentation::SetMinGamma.

Parameters
gammaThe maximum gamma

Gamma correction transformation is performed by raising each normalized pixel value to the power of gamma with gamma taken between EDataAugmentation::SetMinGamma and EDataAugmentation::SetMaxGamma.

◆ SetMaxHorizontalShear()

void eVision::EasyDeepLearning::EDataAugmentation::SetMaxHorizontalShear ( float hShear)

Sets the maximum absolute horizontal shear, represented as an angle from the vertical direction. Its value must be between 0 and 90 degrees.

Parameters
hShearThe maximum horizontal shear allowed

◆ SetMaxHorizontalShift()

void eVision::EasyDeepLearning::EDataAugmentation::SetMaxHorizontalShift ( int32_t maxShift)

Sets the maximum horizontal shift allowed.

Parameters
maxShiftMaximum horizontal shift

◆ SetMaxHueOffset()

void eVision::EasyDeepLearning::EDataAugmentation::SetMaxHueOffset ( float hueOffset)

Sets the maximum absolute hue offset. Its value must be between 0 and 180 degrees.

Parameters
hueOffsetThe maximum hue offset

The hue is represented as an angle between 0 and 360 degrees. The hue transformation is performed by rotating the hue of each pixel by a value between -EDataAugmentation::SetMaxHueOffset and +EDataAugmentation::SetMaxHueOffset. This transformation only works for color images.

◆ SetMaxRotationAngle()

void eVision::EasyDeepLearning::EDataAugmentation::SetMaxRotationAngle ( float maxAngle)

Set the maximum rotation angle allowed. Its value must be between 0 and 180 degrees.

The unit of this angle is in the current angle unit (see Easy::SetAngleUnit).

Parameters
maxAngleThe maximum angle allowed.

◆ SetMaxSaturationGain()

void eVision::EasyDeepLearning::EDataAugmentation::SetMaxSaturationGain ( float saturationGain)

Sets the maximum saturation gain. Its value must be over or equal to EDataAugmentation::SetMinSaturationGain.

Parameters
saturationGainThe maximum saturation gain

The saturation transformation is performed by multiplying the saturation of each pixel by a value between EDataAugmentation::SetMinSaturationGain and EDataAugmentation::SetMaxSaturationGain.

◆ SetMaxScale()

void eVision::EasyDeepLearning::EDataAugmentation::SetMaxScale ( float maxScale)

Sets the maximum scaling allowed. Its value must be strictly positive and over EDataAugmentation::SetMinScale.

Parameters
maxScaleThe maximum scaling allowed

◆ SetMaxStainColor()

void eVision::EasyDeepLearning::EDataAugmentation::SetMaxStainColor ( uint8_t maxStainColor)

The maximum color value from which to draw a color to fill in the stain (we use a gaussian distribution of with a mean between EDataAugmentation::SetMinStainColor and EDataAugmentation::SetMaxStainColor).

Its value must be bigger than EDataAugmentation::SetMinStainColor.

Parameters
maxStainColorThe color

◆ SetMaxVerticalShear()

void eVision::EasyDeepLearning::EDataAugmentation::SetMaxVerticalShear ( float vShear)

Sets the maximum absolute vertical shear, represented as an angle from the horizontal direction. Its value must be between 0 and 90 degrees.

Parameters
vShearThe maximum vertical shear allowed

◆ SetMaxVerticalShift()

void eVision::EasyDeepLearning::EDataAugmentation::SetMaxVerticalShift ( int32_t maxShift)

Sets the maximum vertical shift allowed.

◆ SetMinContrastGain()

void eVision::EasyDeepLearning::EDataAugmentation::SetMinContrastGain ( float val)

Sets the minimum contrast gain. Its value must be strictly positive and below EDataAugmentation::SetMaxContrastGain.

Parameters
valThe minimum contrast gain

Contrast transformation is performed by multiplying each mean-centered pixel value by a gain value taken between EDataAugmentation::SetMinContrastGain and EDataAugmentation::SetMaxContrastGain. A contrast transformation does not change the overall brightness of an image.

◆ SetMinGamma()

void eVision::EasyDeepLearning::EDataAugmentation::SetMinGamma ( float gamma)

Sets the minimum gamma for gamma correction. Its value must be strictly positive and below EDataAugmentation::SetMaxGamma.

Parameters
gammaThe minimum gamma

Gamma correction transformation is performed by raising each normalized pixel value to the power of gamma with gamma taken between EDataAugmentation::SetMinGamma and EDataAugmentation::SetMaxGamma.

◆ SetMinSaturationGain()

void eVision::EasyDeepLearning::EDataAugmentation::SetMinSaturationGain ( float saturationGain)

Sets the minimum saturation gain. Its value must be strictly positive.

Parameters
saturationGainThe minimum saturation gain

The saturation transformation is performed by multiplying the saturation of each pixel by a value between EDataAugmentation::SetMinSaturationGain and EDataAugmentation::SetMaxSaturationGain.

◆ SetMinScale()

void eVision::EasyDeepLearning::EDataAugmentation::SetMinScale ( float minScale)

Sets the minimum scaling allowed. Its value must be strictly positive and below EDataAugmentation::SetMaxScale.

Parameters
minScaleThe minimum scaling allowed

◆ SetMinStainColor()

void eVision::EasyDeepLearning::EDataAugmentation::SetMinStainColor ( uint8_t minStainColor)

The minimum color value from which to draw a color to fill in the stain (we use a gaussian distribution of with a mean between EDataAugmentation::SetMinStainColor and EDataAugmentation::SetMaxStainColor).

Its value must be inferior to 255 and EDataAugmentation::SetMaxStainColor.

Parameters
minStainColorThe color

◆ SetSaltAndPepperNoiseMaximumDensity()

void eVision::EasyDeepLearning::EDataAugmentation::SetSaltAndPepperNoiseMaximumDensity ( float saltAndPepperNoiseMaximumDensity)

The maximum density of the salt and pepper noise.

The salt and pepper noise sets the value of a number of randomly selected (between EDataAugmentation::SetSaltAndPepperNoiseMinimumDensity and EDataAugmentation::SetSaltAndPepperNoiseMaximumDensity) pixels to its minimum or maximum value.

Its value must be between EDataAugmentation::SetSaltAndPepperNoiseMinimumDensity and 1.

Parameters
saltAndPepperNoiseMaximumDensityThe maximum density of the salt and pepper noise expressed in percentage of the total number of pixels of the image

This noise is computed after all the other noises.

◆ SetSaltAndPepperNoiseMinimumDensity()

void eVision::EasyDeepLearning::EDataAugmentation::SetSaltAndPepperNoiseMinimumDensity ( float saltAndPepperNoiseMinimumDensity)

The minimum density of the salt and pepper noise.

The salt and pepper noise sets the value of a number of randomly selected (between EDataAugmentation::SetSaltAndPepperNoiseMinimumDensity and EDataAugmentation::SetSaltAndPepperNoiseMaximumDensity) pixels to its minimum or maximum value.

Its value must be between 0 and EDataAugmentation::SetSaltAndPepperNoiseMinimumDensity.

Parameters
saltAndPepperNoiseMinimumDensityThe minimum density of the salt and pepper noise expressed in percentage of the total number of pixels of the image

This noise is computed after all the other noises.

◆ SetSpeckleNoiseMaximumStandardDeviation()

void eVision::EasyDeepLearning::EDataAugmentation::SetSpeckleNoiseMaximumStandardDeviation ( float speckleNoiseMaximumStandardDeviation)

The speckle noise maximum standard deviation.

The speckle noise is a multiplicative noise sampled from a Gamma distribution of deviation between EDataAugmentation::SetSpeckleNoiseMinimumStandardDeviation and EDataAugmentation::SetSpeckleNoiseMaximumStandardDeviation.

Its value must be strictly higher than EDataAugmentation::SetSpeckleNoiseMinimumStandardDeviation.

Parameters
speckleNoiseMaximumStandardDeviationThe standard maximum deviation of the gamma distribution

This noise is computed before the salt and paper noise.

◆ SetSpeckleNoiseMinimumStandardDeviation()

void eVision::EasyDeepLearning::EDataAugmentation::SetSpeckleNoiseMinimumStandardDeviation ( float speckleNoiseMinimumStandardDeviation)

The speckle noise minimum standard deviation.

The speckle noise is a multiplicative noise sampled from a Gamma distribution of deviation between EDataAugmentation::SetSpeckleNoiseMinimumStandardDeviation and EDataAugmentation::SetSpeckleNoiseMaximumStandardDeviation.

Its value must be strictly positive and lower than EDataAugmentation::SetSpeckleNoiseMaximumStandardDeviation.

Parameters
speckleNoiseMinimumStandardDeviationThe standard minimum deviation of the gamma distribution

This noise is computed before the salt and paper noise.

◆ SetStainBlur()

void eVision::EasyDeepLearning::EDataAugmentation::SetStainBlur ( int blur)

Stain blur.

The stain blur is the half kernel size of a Gaussian filter that is applied on the stain to smooth its edges and therefore the transition between the original image and the stain.

Parameters
blurBlur to apply to the stain

◆ SetStainColorVariation()

void eVision::EasyDeepLearning::EDataAugmentation::SetStainColorVariation ( uint32_t stainColorVariation)

The variation of the color used to fill in the ellipse (We use an gaussian distribution of standard mean deviation stainColorVariation).

Parameters
stainColorVariationThe variation of the color

◆ SetStainDisruptionMaxAnchorPoints()

void eVision::EasyDeepLearning::EDataAugmentation::SetStainDisruptionMaxAnchorPoints ( uint32_t stainDisruptioMaxAnchorPoints)

The maximum number of anchor points to use while disrupting the ellipse.

◆ SetStainDisruptionMaxIntensity()

void eVision::EasyDeepLearning::EDataAugmentation::SetStainDisruptionMaxIntensity ( float stainDisruptionMaxIntensity)

The maximum offset applied to the coordinates (x,y) of a pixel from the ellipse contour.

Parameters
stainDisruptionMaxIntensityThe maximum offset

◆ SetStainEllipseMaxRadius()

void eVision::EasyDeepLearning::EDataAugmentation::SetStainEllipseMaxRadius ( uint32_t stainEllipseMaxRadius)

The maximum radius of the ellipse used to produce the stain.

Its value must be superior to EDataAugmentation::SetStainEllipseMinRadius.

Parameters
stainEllipseMaxRadiusThe maximum radius

◆ SetStainEllipseMinRadius()

void eVision::EasyDeepLearning::EDataAugmentation::SetStainEllipseMinRadius ( uint32_t stainEllipseMinRadius)

The minimum radius of the ellipse used to produce the stain.

Its value must be inferior to EDataAugmentation::SetStainEllipseMaxRadius.

Parameters
stainEllipseMinRadiusThe minimum radius

◆ SetStainInterpolationSiteFactor()

void eVision::EasyDeepLearning::EDataAugmentation::SetStainInterpolationSiteFactor ( float interpolationSiteFactor)

The factor to compute the number of interpolation sites to use from the number of anchor points.

Parameters
interpolationSiteFactorInterpolation site factor.

◆ SetStainProbability()

void eVision::EasyDeepLearning::EDataAugmentation::SetStainProbability ( float stainProbability)

Probability of applying the stain data augmentation (default value: 0, i.e. no stain).

Parameters
stainProbabilityProbability of applying stain data augmentation (between 0 and 1).

Member Data Documentation

◆ wrappedClass_

CppWrapperInternal::WrappedClass eVision::EasyDeepLearning::EDataAugmentation::wrappedClass_