eVision .NET API
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...

Inheritance diagram for eVision.EasyDeepLearning.EDataAugmentation:
Collaboration diagram for eVision.EasyDeepLearning.EDataAugmentation:

Public Member Functions

 EDataAugmentation ()
 Creates an EDataAugmentation object.
 EDataAugmentation (eVision.EasyDeepLearning.EDataAugmentation other)
 Creates a copy of the EDataAugmentation object other.
void CopyTo (eVision.EasyDeepLearning.EDataAugmentation other)
 Copies itself to the EDataAugmentation object other.
void Load (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 (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 ()
 Whether the EDataAugmentation object contains augmentations.
eVision.EBaseROI Generate (eVision.EBaseROI img, eVision.EasyDeepLearning.EDLDataAugmentationType type)
 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.
eVision.EBaseROI Generate (eVision.EBaseROI img)
 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 (eVision.EROIBW8 source, eVision.EROIBW8 dest, eVision.EasyDeepLearning.EDLDataAugmentationType type)
 Generates a new image.
void Generate (eVision.EROIBW8 source, eVision.EROIBW8 dest)
 Generates a new image.
void Generate (eVision.EROIBW16 source, eVision.EROIBW16 dest, eVision.EasyDeepLearning.EDLDataAugmentationType type)
 Generates a new image.
void Generate (eVision.EROIBW16 source, eVision.EROIBW16 dest)
 Generates a new image.
void Generate (eVision.EROIC24 source, eVision.EROIC24 dest, eVision.EasyDeepLearning.EDLDataAugmentationType type)
 Generates a new image.
void Generate (eVision.EROIC24 source, eVision.EROIC24 dest)
 Generates a new image.

Properties

int MaxHorizontalShift [get, set]
 Return the maximum horizontal shift allowed.
int MaxVerticalShift [get, set]
 Return the maximum vertical shift allowed.
float MaxRotationAngle [get, set]
 Returns the maximum rotation angle allowed. The unit of the returned angle is in the current angle unit (see Easy.AngleUnit).
bool EnableVerticalFlip [get, set]
 Gets whether to use vertically flipped versions of input images.
bool EnableHorizontalFlip [get, set]
 Gets whether to use horizontally flipped versions of input images.
float MinScale [get, set]
 Gets the minimum scaling allowed.
float MaxScale [get, set]
 Gets the maximum scaling allowed.
float MaxHorizontalShear [get, set]
 Gets the maximum absolute horizontal shear, represented as an angle from the vertical direction.
float MaxVerticalShear [get, set]
 Gets the maximum absolute vertical shear, represented as an angle from the horizontal direction.
float MaxBrightnessOffset [get, set]
 Gets the maximum absolute brightness offset.
float MaxContrastGain [get, set]
 Gets the maximum contrast gain.
float MinContrastGain [get, set]
 Gets the minimum contrast gain.
float MinGamma [get, set]
 Gets the minimum gamma for gamma correction.
float MaxGamma [get, set]
 Gets the maximum gamma for gamma correction.
float MaxHueOffset [get, set]
 Gets the maximum absolute hue offset.
float MinSaturationGain [get, set]
 Gets the minimum saturation gain.
float MaxSaturationGain [get, set]
 Gets the maximum saturation gain.
float GaussianNoiseMaximumStandardDeviation [get, set]
 The Gaussian noise maximum standard deviation.
float GaussianNoiseMinimumStandardDeviation [get, set]
 The Gaussian noise minimum standard deviation.
float SpeckleNoiseMaximumStandardDeviation [get, set]
 The speckle noise maximum standard deviation.
float SpeckleNoiseMinimumStandardDeviation [get, set]
 The speckle noise minimum standard deviation.
float SaltAndPepperNoiseMaximumDensity [get, set]
 The maximum density of the salt and pepper noise.
float SaltAndPepperNoiseMinimumDensity [get, set]
 The minimum density of the salt and pepper noise.
uint StainDisruptionMaxAnchorPoints [get, set]
 The maximum number of anchor points to use while disrupting the ellipse.
float StainDisruptionMaxIntensity [get, set]
 The maximum offset applied to the coordinates (x,y) of a pixel from the ellipse contour.
uint StainEllipseMinRadius [get, set]
 The minimum radius of the ellipse used to produce the stain.
uint StainEllipseMaxRadius [get, set]
 The maximum radius of the ellipse used to produce the stain.
byte MinStainColor [get, set]
 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.MinStainColor and EDataAugmentation.MaxStainColor).
byte MaxStainColor [get, set]
 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.MinStainColor and EDataAugmentation.MaxStainColor).
uint StainColorVariation [get, set]
 The variation of the color used to fill in the ellipse (We use an gaussian distribution of standard mean deviation stainColorVariation).
float StainInterpolationSiteFactor [get, set]
 The factor to compute the number of interpolation sites to use from the number of anchor points.
float StainProbability [get, set]
 Probability of applying the stain data augmentation (default value: 0, i.e. no stain).
int StainBlur [get, set]
 Stain blur.

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/2]

eVision.EasyDeepLearning.EDataAugmentation.EDataAugmentation ( )

Creates an EDataAugmentation object.

◆ EDataAugmentation() [2/2]

eVision.EasyDeepLearning.EDataAugmentation.EDataAugmentation ( eVision.EasyDeepLearning.EDataAugmentation other)

Creates a copy of the EDataAugmentation object other.

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

Member Function Documentation

◆ CopyTo()

void eVision.EasyDeepLearning.EDataAugmentation.CopyTo ( eVision.EasyDeepLearning.EDataAugmentation other)

Copies itself to the EDataAugmentation object other.

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

◆ Generate() [1/8]

eVision.EBaseROI eVision.EasyDeepLearning.EDataAugmentation.Generate ( eVision.EBaseROI img)

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]

eVision.EBaseROI eVision.EasyDeepLearning.EDataAugmentation.Generate ( eVision.EBaseROI img,
eVision.EasyDeepLearning.EDLDataAugmentationType type )

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 ( eVision.EROIBW16 source,
eVision.EROIBW16 dest )

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 ( eVision.EROIBW16 source,
eVision.EROIBW16 dest,
eVision.EasyDeepLearning.EDLDataAugmentationType type )

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 ( eVision.EROIBW8 source,
eVision.EROIBW8 dest )

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 ( eVision.EROIBW8 source,
eVision.EROIBW8 dest,
eVision.EasyDeepLearning.EDLDataAugmentationType type )

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 ( eVision.EROIC24 source,
eVision.EROIC24 dest )

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 ( eVision.EROIC24 source,
eVision.EROIC24 dest,
eVision.EasyDeepLearning.EDLDataAugmentationType type )

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.

◆ HasDataAugmentations()

bool eVision.EasyDeepLearning.EDataAugmentation.HasDataAugmentations ( )

Whether the EDataAugmentation object contains augmentations.

◆ Load() [1/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.

◆ Load() [2/2]

void eVision.EasyDeepLearning.EDataAugmentation.Load ( string path)

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

Parameters
pathThe file path.

◆ Save() [1/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.

◆ Save() [2/2]

void eVision.EasyDeepLearning.EDataAugmentation.Save ( string path)

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

Parameters
pathThe file path.

Property Documentation

◆ EnableHorizontalFlip

bool eVision.EasyDeepLearning.EDataAugmentation.EnableHorizontalFlip
getset

Gets whether to use horizontally flipped versions of input images.

◆ EnableVerticalFlip

bool eVision.EasyDeepLearning.EDataAugmentation.EnableVerticalFlip
getset

Gets whether to use vertically flipped versions of input images.

◆ GaussianNoiseMaximumStandardDeviation

float eVision.EasyDeepLearning.EDataAugmentation.GaussianNoiseMaximumStandardDeviation
getset

The Gaussian noise maximum standard deviation.

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

Its value must be superior or equal to EDataAugmentation.GaussianNoiseMinimumStandardDeviation.

This noise is computed before the salt and paper noise.

◆ GaussianNoiseMinimumStandardDeviation

float eVision.EasyDeepLearning.EDataAugmentation.GaussianNoiseMinimumStandardDeviation
getset

The Gaussian noise minimum standard deviation.

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

Its value must be between 0 and EDataAugmentation.GaussianNoiseMaximumStandardDeviation.

This noise is computed before the salt and paper noise.

◆ MaxBrightnessOffset

float eVision.EasyDeepLearning.EDataAugmentation.MaxBrightnessOffset
getset

Gets the maximum absolute brightness offset.

◆ MaxContrastGain

float eVision.EasyDeepLearning.EDataAugmentation.MaxContrastGain
getset

Gets the maximum contrast gain.

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

◆ MaxGamma

float eVision.EasyDeepLearning.EDataAugmentation.MaxGamma
getset

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.MinGamma and EDataAugmentation.MaxGamma.

◆ MaxHorizontalShear

float eVision.EasyDeepLearning.EDataAugmentation.MaxHorizontalShear
getset

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

◆ MaxHorizontalShift

int eVision.EasyDeepLearning.EDataAugmentation.MaxHorizontalShift
getset

Return the maximum horizontal shift allowed.

◆ MaxHueOffset

float eVision.EasyDeepLearning.EDataAugmentation.MaxHueOffset
getset

Gets the maximum absolute hue offset.

◆ MaxRotationAngle

float eVision.EasyDeepLearning.EDataAugmentation.MaxRotationAngle
getset

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

◆ MaxSaturationGain

float eVision.EasyDeepLearning.EDataAugmentation.MaxSaturationGain
getset

Gets the maximum saturation gain.

◆ MaxScale

float eVision.EasyDeepLearning.EDataAugmentation.MaxScale
getset

Gets the maximum scaling allowed.

◆ MaxStainColor

byte eVision.EasyDeepLearning.EDataAugmentation.MaxStainColor
getset

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.MinStainColor and EDataAugmentation.MaxStainColor).

Its value must be bigger than EDataAugmentation.MinStainColor.

◆ MaxVerticalShear

float eVision.EasyDeepLearning.EDataAugmentation.MaxVerticalShear
getset

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

◆ MaxVerticalShift

int eVision.EasyDeepLearning.EDataAugmentation.MaxVerticalShift
getset

Return the maximum vertical shift allowed.

◆ MinContrastGain

float eVision.EasyDeepLearning.EDataAugmentation.MinContrastGain
getset

Gets the minimum contrast gain.

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

◆ MinGamma

float eVision.EasyDeepLearning.EDataAugmentation.MinGamma
getset

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.MinGamma and EDataAugmentation.MaxGamma.

◆ MinSaturationGain

float eVision.EasyDeepLearning.EDataAugmentation.MinSaturationGain
getset

Gets the minimum saturation gain.

◆ MinScale

float eVision.EasyDeepLearning.EDataAugmentation.MinScale
getset

Gets the minimum scaling allowed.

◆ MinStainColor

byte eVision.EasyDeepLearning.EDataAugmentation.MinStainColor
getset

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.MinStainColor and EDataAugmentation.MaxStainColor).

Its value must be inferior to 255 and EDataAugmentation.MaxStainColor.

◆ SaltAndPepperNoiseMaximumDensity

float eVision.EasyDeepLearning.EDataAugmentation.SaltAndPepperNoiseMaximumDensity
getset

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.SaltAndPepperNoiseMinimumDensity and EDataAugmentation.SaltAndPepperNoiseMaximumDensity) pixels to its minimum or maximum value.

Its value must be between EDataAugmentation.SaltAndPepperNoiseMinimumDensity and 1.

This noise is computed after all the other noises.

◆ SaltAndPepperNoiseMinimumDensity

float eVision.EasyDeepLearning.EDataAugmentation.SaltAndPepperNoiseMinimumDensity
getset

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.SaltAndPepperNoiseMinimumDensity and EDataAugmentation.SaltAndPepperNoiseMaximumDensity) pixels to its minimum or maximum value.

Its value must be between 0 and EDataAugmentation.SaltAndPepperNoiseMinimumDensity.

This noise is computed after all the other noises.

◆ SpeckleNoiseMaximumStandardDeviation

float eVision.EasyDeepLearning.EDataAugmentation.SpeckleNoiseMaximumStandardDeviation
getset

The speckle noise maximum standard deviation.

The speckle noise is a multiplicative noise sampled from a Gamma distribution of deviation between EDataAugmentation.SpeckleNoiseMinimumStandardDeviation and EDataAugmentation.SpeckleNoiseMaximumStandardDeviation.

Its value must be strictly higher than EDataAugmentation.SpeckleNoiseMinimumStandardDeviation.

This noise is computed before the salt and paper noise.

◆ SpeckleNoiseMinimumStandardDeviation

float eVision.EasyDeepLearning.EDataAugmentation.SpeckleNoiseMinimumStandardDeviation
getset

The speckle noise minimum standard deviation.

The speckle noise is a multiplicative noise sampled from a Gamma distribution of deviation between EDataAugmentation.SpeckleNoiseMinimumStandardDeviation and EDataAugmentation.SpeckleNoiseMaximumStandardDeviation.

Its value must be strictly positive and lower than EDataAugmentation.SpeckleNoiseMaximumStandardDeviation.

This noise is computed before the salt and paper noise.

◆ StainBlur

int eVision.EasyDeepLearning.EDataAugmentation.StainBlur
getset

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.

◆ StainColorVariation

uint eVision.EasyDeepLearning.EDataAugmentation.StainColorVariation
getset

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

◆ StainDisruptionMaxAnchorPoints

uint eVision.EasyDeepLearning.EDataAugmentation.StainDisruptionMaxAnchorPoints
getset

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

◆ StainDisruptionMaxIntensity

float eVision.EasyDeepLearning.EDataAugmentation.StainDisruptionMaxIntensity
getset

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

◆ StainEllipseMaxRadius

uint eVision.EasyDeepLearning.EDataAugmentation.StainEllipseMaxRadius
getset

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

Its value must be superior to EDataAugmentation.StainEllipseMinRadius.

◆ StainEllipseMinRadius

uint eVision.EasyDeepLearning.EDataAugmentation.StainEllipseMinRadius
getset

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

Its value must be inferior to EDataAugmentation.StainEllipseMaxRadius.

◆ StainInterpolationSiteFactor

float eVision.EasyDeepLearning.EDataAugmentation.StainInterpolationSiteFactor
getset

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

◆ StainProbability

float eVision.EasyDeepLearning.EDataAugmentation.StainProbability
getset

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