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

EDataset manages a dataset of images. More...

#include <eVision/EasyDeepLearning/EDataset.h>

Inheritance diagram for eVision::EasyDeepLearning::EDataset:
Collaboration diagram for eVision::EasyDeepLearning::EDataset:

Public Member Functions

 EDataset ()
 Constructs a EDataset object.
 EDataset (const eVision::EasyDeepLearning::EDataset &other)
 Copy constructor of a EDataset object.
virtual ~EDataset () throw ()
eVision::EasyDeepLearning::EDataset & operator= (const eVision::EasyDeepLearning::EDataset &other)
 Assignment operator.
void Load (const std::string &path)
 Loads a classification dataset from disk.
void Load (eVision::ESerializer *serializer)
 Loads a classification dataset from disk.
void Save (const std::string &path)
 Saves a classification dataset to disk, containing the file paths to the images in the dataset and their associated label.
void Save (eVision::ESerializer *serializer)
 Saves a classification dataset to disk, containing the file paths to the images in the dataset and their associated label.
void SaveWithRelativePath (const std::string &path)
 Saves the dataset with image paths relative to the directory in which the dataset file is saved.
void SetBasePath (const std::string &basePath)
 Sets the base path for the images specified with a relative path.
void Export (const std::string &directory, eVision::EImageFileType fileType, int quality) const
 Exports the dataset and its images to the given directory.
void Export (const std::string &directory, eVision::EImageFileType fileType) const
 Exports the dataset and its images to the given directory.
void Export (const std::string &directory) const
 Exports the dataset and its images to the given directory.
void Export (const std::string &directory, bool keepFilename, eVision::EImageFileType fileType, int quality) const
 Exports the dataset and its images to the given directory.
void Export (const std::string &directory, bool keepFilename, eVision::EImageFileType fileType) const
 Exports the dataset and its images to the given directory.
void Export (const std::string &directory, bool keepFilename) const
 Exports the dataset and its images to the given directory.
void Export (const std::string &directory, int width, int height, int channels, eVision::EImageFileType fileType, int quality) const
 Exports the dataset and its images to the given directory.
void Export (const std::string &directory, int width, int height, int channels, eVision::EImageFileType fileType) const
 Exports the dataset and its images to the given directory.
void Export (const std::string &directory, int width, int height, int channels) const
 Exports the dataset and its images to the given directory.
void Export (const std::string &directory, int width, int height, int channels, bool keepFilename, eVision::EImageFileType fileType, int quality) const
 Exports the dataset and its images to the given directory.
void Export (const std::string &directory, int width, int height, int channels, bool keepFilename, eVision::EImageFileType fileType) const
 Exports the dataset and its images to the given directory.
void Export (const std::string &directory, int width, int height, int channels, bool keepFilename) const
 Exports the dataset and its images to the given directory.
virtual void Clear ()
 Clears the dataset.
uint32_t GetWidth () const
 Width of the region of interest of the first image added to the dataset.
uint32_t GetHeight () const
 Height of the region of interest of the first image added to the dataset.
uint32_t GetChannels () const
 Number of channels of the first image added to the dataset.
eVision::EasyDeepLearning::EImageAnnotationFormat GetAvailableImageAnnotationFormat (const std::string &imageFile) const
 Image annotation file formats that are available next to the image file.
eVision::EasyDeepLearning::EImageAnnotationFormat GetAvailableImageAnnotationFormat (int imgId) const
 Image annotation file formats that are available next to the image file.
void ImportYOLOTXTAnnotations (int imgId, const std::string &labelFile)
 Imports YOLO TXT annotations (for EasyLocate Bounding Box).
void ImportYOLOTXTAnnotations (const std::string &labelFile)
 Imports YOLO TXT annotations (for EasyLocate Bounding Box).
void ImportPascalVOCXMLAnnotations (int imgId)
 Imports Pascal VOC XML annotations (for EasyLocate Bounding Box).
void ImportPascalVOCXMLAnnotations ()
 Imports Pascal VOC XML annotations (for EasyLocate Bounding Box).
int AddImage (const std::string &imagePath)
 Adds an image to the dataset.
int AddImage (const std::string &imagePath, const std::string &label)
 Adds an image to the dataset.
int AddImage (const std::string &imagePath, int originX, int originY, int width, int height, const eVision::ERegion &mask)
 Adds an image to the dataset.
int AddImage (const std::string &imagePath, int originX, int originY, int width, int height, const eVision::ERegion &mask, const std::string &label)
 Adds an image to the dataset.
int AddImage (const eVision::EBaseROI &img)
 Adds an image to the dataset.
int AddImage (const eVision::EBaseROI &img, const std::string &label)
 Adds an image to the dataset.
int AddImage (const eVision::EBaseROI &img, int originX, int originY, int width, int height, const eVision::ERegion &mask)
 Adds an image to the dataset.
int AddImage (const eVision::EBaseROI &img, int originX, int originY, int width, int height, const eVision::ERegion &mask, const std::string &label)
 Adds an image to the dataset.
int AddImages (const std::string &filter)
 Adds all the images present in the directory specified by the parameter path and whose filename matches the filter.
int AddImages (const std::string &filter, const std::string &label)
 Adds all the images present in the directory specified by the parameter path and whose filename matches the filter.
int AddImages (const std::string &filter, int originX, int originY, int width, int height, const eVision::ERegion &mask)
 Adds all the images present in the directory specified by the parameter path and whose filename matches the filter.
int AddImages (const std::string &filter, int originX, int originY, int width, int height, const eVision::ERegion &mask, const std::string &label)
 Adds all the images present in the directory specified by the parameter path and whose filename matches the filter.
int AddImagesFromCSV (const std::string &csvFile, int imageColumn, int labelColumn, int skipLines, const std::string &separator)
 Adds images using a CSV (Comma Separated Value) file where each row correspond to an image and the file path and label of each image is given in the columns imageColumn and labelColumn respectively.
int AddImagesFromCSV (const std::string &csvFile, int imageColumn, int labelColumn, int skipLines)
 Adds images using a CSV (Comma Separated Value) file where each row correspond to an image and the file path and label of each image is given in the columns imageColumn and labelColumn respectively.
int AddImagesFromCSV (const std::string &csvFile, int imageColumn, int labelColumn)
 Adds images using a CSV (Comma Separated Value) file where each row correspond to an image and the file path and label of each image is given in the columns imageColumn and labelColumn respectively.
int AddImagesFromCSV (const std::string &csvFile, int imageColumn)
 Adds images using a CSV (Comma Separated Value) file where each row correspond to an image and the file path and label of each image is given in the columns imageColumn and labelColumn respectively.
int AddImagesFromCSV (const std::string &csvFile)
 Adds images using a CSV (Comma Separated Value) file where each row correspond to an image and the file path and label of each image is given in the columns imageColumn and labelColumn respectively.
void RemoveImage (int imgId)
 Removes the image at the given index. All annotations (label, segmentation, objects) will be lost.
int GetNumImages () const
 Number of images in the dataset.
int GetNumImageFiles () const
 Number of different image files contained in the dataset.
int GetNumImagesForFile (const std::string &filePath) const
 Get the number of images in the dataset that are associated with the given image file.
std::unique_ptr< eVision::EBaseROI > GetImageCopy (int index) const
 Gets a copy of the i-th image of the dataset.
void GetImageCopy (int index, eVision::EBaseROI &img) const
 Gets a copy of the i-th image of the dataset.
std::string GetImagePath (int index) const
 Gets the path of the i-th image of the dataset. If the image was not given using a path, the method will throw an exception.
bool IsImageFile (int index) const
 Whether the image is stored as a file path towards an image.
bool IsEmbeddedImage (int index) const
 Whether the image is embedded into the dataset and is not a reference towards an image file.
std::string GetImageLabel (int index) const
 Gets the label of the i-th image of the dataset. An exception is thrown if the image has no classification label.
void SetImageLabel (int index, const std::string &label)
 Sets the label of images in the dataset.
void SetImageLabel (const std::string &filter, const std::string &label)
 Sets the label of images in the dataset.
void UnsetImageLabel (int index)
 Unset the label of the given image of the dataset. After this operation, the given image will have no classification labels.
bool HasLabel (int index) const
 Whether an image has a classification label.
int GetNumLabeledImages () const
 Number of images that have a classification label.
int GetNumUnlabeledImages () const
 Number of images that doesn't have any classification label.
std::vector< uint32_t > GetImagesIndexesWithLabel (const std::string &label) const
 Gets a list of index corresponding to the images associated with the given label.
std::vector< uint32_t > GetImagesIndexesWithLabel (int labelIndex) const
 Gets a list of index corresponding to the images associated with the given label.
std::vector< int > GetLabeledImagesIndexes () const
 Gets a list of index corresponding to the images that have a classification label.
std::vector< int > GetTextLabeledImagesIndexes () const
 Gets a list of index corresponding to the images that have a text only label.
std::vector< int > GetImagesIndexesWithNoLabel () const
 Gets a list of index corresponding to the images with no classification labels.
int GetNumLabels () const
 Number of labels in the dataset.
void AddLabel (const std::string &label)
 Adds a label to the dataset.
std::string GetLabel (int i) const
 Gets the i-th label of the dataset (starting from 0 to EDataset::GetNumLabels - 1).
void SetLabel (int index, const std::string &label)
 Sets the i-th label of the dataset (starting from 0 to EDataset::GetNumLabels - 1). This operation does not add a new label to the dataset but simply renames an existing label.
float GetLabelWeight (int index) const
 Gets the weight associated to the i-th label of the dataset (starting from 0 to EDataset::GetNumLabels - 1).
void SetLabelWeight (int index, const float &weight)
 Sets the weight associated to the i-th label of the dataset (starting from 0 to EDataset::GetNumLabels - 1). This operation does not add a new label.
void SetLabelColor (int index, const eVision::ERGBColor &color)
 Sets the label color for a classification label.
eVision::ERGBColor GetLabelColor (int index) const
 Gets the label color for a classification label.
void SetLabelOpacity (int index, const uint8_t opacity)
 Sets the label opacity for a classification label.
uint8_t GetLabelOpacity (int index) const
 Gets the label opacity for a classification label.
void RemoveLabel (const std::string &label)
 Removes a label from the dataset.
void RemoveLabel (int labelId)
 Removes a label from the dataset.
void SetSegmentationMap (int imageIndex, const eVision::EROIBW16 &segmentationMap)
 Sets the segmentation map of an image. The segmentation map is a 16-bit EROIBW16 image where the value of each pixel is equal to the corresponding segmentation label index (see EDataset::GetSegmentationLabel).
eVision::EImageBW16 GetSegmentationMap (int imageIndex) const
 Gets the segmentation map of an image. The segmentation map is a 16-bit EROIBW16 image where the value of each pixel is equal to the corresponding segmentation label index (see EDataset::GetSegmentationLabel).
void UnsetSegmentation (int imageIndex)
 Unsets the segmentation of an image. After this operation, the image will have no segmentation.
void ResetSegmentation (int imageIndex)
 Resets the segmentation of an image by setting all pixels to background.
void AddRegionToSegment (int imageIndex, int segmentationLabelIndex, const eVision::ERegion &region)
 Adds a region (see ERegion) to the given segment of an image. If, before this call, the image had no segmentation, the pixels not in the given region will be set to the background segmentation label.
void AddRegionToSegment (int imageIndex, const std::string &label, const eVision::ERegion &region)
 Adds a region (see ERegion) to the given segment of an image. If, before this call, the image had no segmentation, the pixels not in the given region will be set to the background segmentation label.
eVision::ERegion GetRegionForSegment (int imageIndex, int segmentationLabelIndex)
 Gets a region corresponding to the pixels of the given segment.
eVision::ERegion GetRegionForSegment (int imageIndex, const std::string &segmentationLabel)
 Gets a region corresponding to the pixels of the given segment.
int GetNumSegmentationLabels () const
 Number of segmentation labels. A dataset has always at least one segmentation label: "background".
int GetNumImagesForSegmentationLabel (int labelId) const
 Number of images containing the given segmentation label.
int GetNumImagesForSegmentationLabel (const std::string &label) const
 Number of images containing the given segmentation label.
uint64_t GetNumPixelsForSegmentationLabel (int labelId) const
 Number of pixels assigned to the given segmentation label.
uint64_t GetNumPixelsForSegmentationLabel (const std::string &label) const
 Number of pixels assigned to the given segmentation label.
bool HasSegmentation (int imageId) const
 Whether the image has a segmentation.
bool HasForegroundSegments (int imageId) const
 Whether the image segmentation contains segments that are not background. If the image has no segmentation, this method throws an exception.
int GetNumSegmentedBlobs (int imageId) const
 Number of segmented blobs in the image for all non-background labels or for a specific label.
int GetNumSegmentedBlobs (int imageId, const std::string &label) const
 Number of segmented blobs in the image for all non-background labels or for a specific label.
int GetNumSegmentedBlobs (int imageId, int labelId) const
 Number of segmented blobs in the image for all non-background labels or for a specific label.
std::string GetSegmentationLabel (int index) const
 Gets the segmentation label.
void SetSegmentationLabel (int index, const std::string &label)
 Sets the segmentation labels.
int AddSegmentationLabel (const std::string &label, float labelWeight)
 Adds a segmentation label. The index of the new segmentation labels is returned by the method.
int AddSegmentationLabel (const std::string &label)
 Adds a segmentation label. The index of the new segmentation labels is returned by the method.
void RemoveSegmentationLabel (const std::string &label)
 Remove a segmentation label.
void RemoveSegmentationLabel (int index)
 Remove a segmentation label.
float GetSegmentationLabelWeight (int index) const
 Gets the segmentation label weights.
float GetSegmentationLabelWeight (const std::string &label) const
 Gets the segmentation label weights.
void SetSegmentationLabelWeight (int index, float weight)
 Sets the segmentation label weight.
void SetSegmentationLabelWeight (const std::string &label, float weight)
 Sets the segmentation label weight.
void SetSegmentationLabelColor (int index, const eVision::ERGBColor &color)
 Sets the label color for a segmentation label.
eVision::ERGBColor GetSegmentationLabelColor (int index) const
 Gets the label color for a segmentation label.
void SetSegmentationLabelOpacity (int index, const uint8_t opacity)
 Sets the label opacity for a segmentation label.
uint8_t GetSegmentationLabelOpacity (int index) const
 Gets the label opacity for a segmentation label.
int GetNumImagesWithSegmentation () const
 Number of images that have a ground truth segmentation.
int GetNumImagesWithoutSegmentation () const
 Number of images that doesn't have a ground truth segmentation.
int GetNumImagesWithoutForegroundSegments () const
 Number of images that have a ground truth segmentation that has no foreground segments and is thus entirely composed of background pixels.
int GetNumImagesWithForegroundSegments () const
 Number of images that have a ground truth segmentation that has foreground segments and is this not entirely composed of background pixels.
void ResetImageObjectLabeling (int imageIndex)
 Resets the object labeling for the specified image. This sets the image as having been labeled for object detection with no object present in the image.
void UnsetImageObjectLabeling (int imageIndex)
 Unsets the object labeling for the specified image. This sets the image as not having been labeled for object detection. This image won't be use for training with a ELocator tool.
std::vector< eVision::EasyDeepLearning::ELocatorObject > GetImageObjects (int imageIndex) const
 Gets all the objects of the specified image.
int GetImageNumObjects (int imageIndex) const
 Number of objects for the specified image.
eVision::EasyDeepLearning::ELocatorObject GetImageObject (int imageIndex, int objectIndex) const
 Gets the specified object for the given image.
void SetImageObject (int imageIndex, int objectIndex, const eVision::EasyDeepLearning::ELocatorObject &obj)
 Sets the specified object for the given image.
void SetImageObject (int imageIndex, int objectIndex, const std::string &label)
 Sets the specified object for the given image.
void SetImageObject (int imageIndex, int objectIndex, const eVision::ERectangleRegion &region)
 Sets the specified object for the given image.
void AddImageObject (int imageIndex, const eVision::EasyDeepLearning::ELocatorObject &obj)
 Adds an object to the image.
void AddImageObject (int imageIndex, const std::string &label, const eVision::ERectangleRegion &box)
 Adds an object to the image.
void RemoveImageObject (int imageIndex, int objectIndex)
 Removes an object from an image.
int GetNumObjectLabels () const
 Number of object labels.
std::string GetObjectLabel (int labelIndex) const
 Object label.
void SetObjectLabel (int labelIndex, const std::string &newLabel)
 Sets an object label.
void SetObjectLabel (const std::string &oldLabel, const std::string &newLabel)
 Sets an object label.
void AddObjectLabel (const std::string &label, float weight)
 Adds an object label.
void AddObjectLabel (const std::string &label)
 Adds an object label.
void RemoveObjectLabel (int labelIndex)
 Removes an object label.
void RemoveObjectLabel (const std::string &label)
 Removes an object label.
void SetObjectLabelWeight (int labelIndex, float weight)
 Sets the weight of an object label.
void SetObjectLabelWeight (const std::string &label, float weight)
 Sets the weight of an object label.
float GetObjectLabelWeight (int labelIndex) const
 Gets the weight of an object label.
float GetObjectLabelWeight (const std::string &label) const
 Gets the weight of an object label.
void SetObjectLabelColor (int index, const eVision::ERGBColor &color)
 Sets the label color for an object label.
eVision::ERGBColor GetObjectLabelColor (int index) const
 Gets the label color for an object label.
void SetObjectLabelOpacity (int index, const uint8_t opacity)
 Sets the label opacity for an object label.
uint8_t GetObjectLabelOpacity (int index) const
 Gets the label opacity for an object label.
bool HasObjectLabeling (int imageIndex) const
 Whether the image is labeled for object detection and use with ELocator.
int GetNumImagesWithObjectLabeling () const
 Number of images in the dataset that are labeled for object detection.
int GetNumImagesWithoutObjectLabeling () const
 Number of images in the dataset that are not labeled for object detection.
int GetNumImagesWithoutObjects () const
 Number of images in the dataset that are labeled for object detection but have been associated with no object.
int GetNumImagesWithObjects () const
 Number of images in the dataset that are labeled for object detection and have 1 or more objects.
int GetNumImagesWithObjectLabel (int labelIdx) const
 Number of images that contain an object with the given label.
int GetNumImagesWithObjectLabel (const std::string &label) const
 Number of images that contain an object with the given label.
uint64_t GetNumObjectsWithLabel (int labelIdx) const
 Number of objects with the given label.
uint64_t GetNumObjectsWithLabel (const std::string &label) const
 Number of objects with the given label.
float GetSameLabelMaxOverlap () const
 Maximum overlap between objects with the same label in the dataset.
float GetAbsoluteMaxOverlap () const
 Absolute maximum overlap between objects in the dataset.
int GetMaxNumObjectPerImage () const
 Maximum number of objects for an image in the dataset. If no images has object labeling (see EDataset::HasObjectLabeling), the method returns -1.
void SetObjectSize (int objectSize)
 Object size for EasyLocate Interest point.
int GetObjectSize () const
 Object size for EasyLocate Interest point.
bool HasOCRAnnotations (int imgId) const
 Whether the specified image has OCR annotations.
void UnsetOCRAnnotations (int imgId)
 Unsets the OCR labeling for the specified image.
std::vector< eVision::EasyDeepOCR::ETextLine > GetOCRAnnotations (int imgId) const
 Ground truth text lines for the specified image.
void SetOCRAnnotations (int imgId, const std::vector< eVision::EasyDeepOCR::ETextLine > &texts)
 Sets the ground truth text lines for the specified image.
int GetNumImagesWithOCR () const
 Number of images with OCR annotations.
int GetNumImagesWithoutOCR () const
 Number of images without OCR annotations.
int GetNumTexts () const
 Number of annotated texts in the dataset.
eVision::EasyDeepLearning::EDataset GetTextDataset () const
 Transforms the current dataset to have only subwindow containing the actual text to read.
eVision::EasyDeepLearning::EDataset GetTextOrientationDataset () const
 Transforms the current text dataset to duplicate it with half image flipped, adding corresponding ground truth.
void SplitDataset (eVision::EasyDeepLearning::EDataset &d1, eVision::EasyDeepLearning::EDataset &d2, float proportion, bool random) const
 Splits the dataset in two parts to be used for training and validation respectively.
void SplitDataset (eVision::EasyDeepLearning::EDataset &d1, eVision::EasyDeepLearning::EDataset &d2, float proportion) const
 Splits the dataset in two parts to be used for training and validation respectively.
void SplitDataset (eVision::EasyDeepLearning::EDataset &d1, eVision::EasyDeepLearning::EDataset &d2) const
 Splits the dataset in two parts to be used for training and validation respectively.
void SplitDatasetForSegmentation (eVision::EasyDeepLearning::EDataset &d1, eVision::EasyDeepLearning::EDataset &d2, float proportion, bool random) const
 Splits the dataset in two parts for a supervised segmenter. The two parts are to be used for training and validation respectively.
void SplitDatasetForSegmentation (eVision::EasyDeepLearning::EDataset &d1, eVision::EasyDeepLearning::EDataset &d2, float proportion) const
 Splits the dataset in two parts for a supervised segmenter. The two parts are to be used for training and validation respectively.
void SplitDatasetForSegmentation (eVision::EasyDeepLearning::EDataset &d1, eVision::EasyDeepLearning::EDataset &d2) const
 Splits the dataset in two parts for a supervised segmenter. The two parts are to be used for training and validation respectively.
void SplitDatasetForLocator (eVision::EasyDeepLearning::EDataset &d1, eVision::EasyDeepLearning::EDataset &d2, float proportion, bool random) const
 Splits the dataset in two parts for training and validation of a ELocator tool. Images without object labeling are excluded from the split.
void SplitDatasetForLocator (eVision::EasyDeepLearning::EDataset &d1, eVision::EasyDeepLearning::EDataset &d2, float proportion) const
 Splits the dataset in two parts for training and validation of a ELocator tool. Images without object labeling are excluded from the split.
void SplitDatasetForLocator (eVision::EasyDeepLearning::EDataset &d1, eVision::EasyDeepLearning::EDataset &d2) const
 Splits the dataset in two parts for training and validation of a ELocator tool. Images without object labeling are excluded from the split.
eVision::EasyDeepLearning::EDatasetSplit GetSplit (float trainingProportion, float validationPropotion, eVision::EasyDeepLearning::EDeepLearningToolType toolType, const std::string &goodLabel) const
 Generates a split.
eVision::EasyDeepLearning::EDatasetSplit GetSplit (float trainingProportion, float validationPropotion, eVision::EasyDeepLearning::EDeepLearningToolType toolType, const std::string &goodLabel, uint32_t seed) const
 Generates a split.
eVision::EasyDeepLearning::EDatasetSplit GetSplit (int numTrainingImages, int numValidationImages, eVision::EasyDeepLearning::EDeepLearningToolType toolType, const std::string &goodLabel) const
 Generates a split.
eVision::EasyDeepLearning::EDatasetSplit GetSplit (int numTrainingImages, int numValidationImages, eVision::EasyDeepLearning::EDeepLearningToolType toolType, const std::string &goodLabel, uint32_t seed) const
 Generates a split.
eVision::EasyDeepLearning::EDataset ExtractSplit (const eVision::EasyDeepLearning::EDatasetSplit &split, eVision::EasyDeepLearning::EDatasetType type) const
 Creates a new EDataset containing only the images of the given split type.
void SetRegionOfInterest (int imageIndex, int xOrg, int yOrg, int width, int height)
 Sets the region of interest for the specified image.
int GetRegionOfInterestOriginX (int imageIndex) const
 Region of interest origin abscissa for the specified image.
int GetRegionOfInterestOriginY (int imageIndex) const
 Region of interest origin ordinate for the specified image.
int GetRegionOfInterestWidth (int imageIndex) const
 Region of interest width for the specified image.
int GetRegionOfInterestHeight (int imageIndex) const
 Region of interest height for the specified image.
eVision::ERegion GetMask (int imageIndex) const
 Gets the mask region/don't care area for the given image. The mask is defined with respect to the region of interest of the image.
void SetMask (int imageIndex, const eVision::ERegion &mask)
 Sets the mask region/don't care area for the given image. The mask is defined with respect to the region of interest of the image.
 EDataset (CppWrapperInternal::InternalConstructor)

Public Attributes

CppWrapperInternal::WrappedClass wrappedClass_

Detailed Description

EDataset manages a dataset of images.

A dataset is a collection of images with different types of labeling: labeling for the classification of images, labeling for the segmentation of pixels, and/or labeling for the detection of objects (classification and localization).

The dataset maintains 3 sets of labels for each type of labeling:

  • the classification labels that characterize an entire image;
  • the segmentation labels that characterize the pixels of an image; and
  • the object labels that characterize axis-aligned rectangle region of an image.

The classification and segmentation labels are entirely user defined. The set of segmentation labels will always contain at least the "Background" label representing pixels of the images that have no relevant information for your task (for example, in a defect segmentation application, the "Background" pixels would be the pixels without any defects).

For each type of labeling, an image can either be unlabeled or labeled. When an image in unlabeled for a given type of labeling, the image won't be used for training a deep learning tool that requires this type of labeling.

The image in the dataset can be stored as path to an image file or as an eVision image structure. Supported structures are 8-bits monochrome (EImageBW8), 16-bits monochrome (EImageBW16), and 24-bits color (EROIC24, EImageC24).

The dataset associates with each image a region of interest and a mask/don't care area. By default, the region of interest of an image is its full extent and its mask is empty.

A dataset can contain images with different sizes (with and height of their region of interest). However, the dataset has a default resolution (see EDataset::GetWidth and EDataset::GetHeight) that is used by deep learning tools that require the same input image size such as the EClassifier. When the images have different sizes, the default resolution will be the resolution of the region of interest of the first image added to the dataset.

License(s): BasicTypes

Constructor & Destructor Documentation

◆ EDataset() [1/3]

eVision::EasyDeepLearning::EDataset::EDataset ( )

Constructs a EDataset object.

◆ EDataset() [2/3]

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

Copy constructor of a EDataset object.

Parameters
otherReference to the EDataset object that should be copied

◆ ~EDataset()

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

◆ EDataset() [3/3]

eVision::EasyDeepLearning::EDataset::EDataset ( CppWrapperInternal::InternalConstructor )

Member Function Documentation

◆ AddImage() [1/8]

int eVision::EasyDeepLearning::EDataset::AddImage ( const eVision::EBaseROI & img)

Adds an image to the dataset.

The image can be specified by its path on the filesystem (parameter imagePath) or by an eVision image buffer (parameter img).

By default, an image will have no classification label and no segmentation. The label of the image can be directly specified when adding the image to the dataset. If the given label was not in the classification labels of the dataset, it will be automatically added to them.

If no region of interest and/or mask is specified, the region of interest of the image will be its full extent and its mask will be empty.

The method returns the index of the image in the dataset. This index is equal to EDataset::GetNumImages - 1 and can be used to add, remove, or modify the annotations for the image.

Parameters
imgThe image

When adding eVision images (EBaseROI) to a dataset, the dataset will retain a copy of the image.

When specifying an individual region of interest and/or mask, the dataset will retain a copy of these.

◆ AddImage() [2/8]

int eVision::EasyDeepLearning::EDataset::AddImage ( const eVision::EBaseROI & img,
const std::string & label )

Adds an image to the dataset.

The image can be specified by its path on the filesystem (parameter imagePath) or by an eVision image buffer (parameter img).

By default, an image will have no classification label and no segmentation. The label of the image can be directly specified when adding the image to the dataset. If the given label was not in the classification labels of the dataset, it will be automatically added to them.

If no region of interest and/or mask is specified, the region of interest of the image will be its full extent and its mask will be empty.

The method returns the index of the image in the dataset. This index is equal to EDataset::GetNumImages - 1 and can be used to add, remove, or modify the annotations for the image.

Parameters
imgThe image
labelThe label

When adding eVision images (EBaseROI) to a dataset, the dataset will retain a copy of the image.

When specifying an individual region of interest and/or mask, the dataset will retain a copy of these.

◆ AddImage() [3/8]

int eVision::EasyDeepLearning::EDataset::AddImage ( const eVision::EBaseROI & img,
int originX,
int originY,
int width,
int height,
const eVision::ERegion & mask )

Adds an image to the dataset.

The image can be specified by its path on the filesystem (parameter imagePath) or by an eVision image buffer (parameter img).

By default, an image will have no classification label and no segmentation. The label of the image can be directly specified when adding the image to the dataset. If the given label was not in the classification labels of the dataset, it will be automatically added to them.

If no region of interest and/or mask is specified, the region of interest of the image will be its full extent and its mask will be empty.

The method returns the index of the image in the dataset. This index is equal to EDataset::GetNumImages - 1 and can be used to add, remove, or modify the annotations for the image.

Parameters
imgThe image
originXRegion of interest origin abscissa
originYRegion of interest origin ordinate
widthRegion of interest width
heightRegion of interest height
maskThe mask for the image (with respect to the region of interest)

When adding eVision images (EBaseROI) to a dataset, the dataset will retain a copy of the image.

When specifying an individual region of interest and/or mask, the dataset will retain a copy of these.

◆ AddImage() [4/8]

int eVision::EasyDeepLearning::EDataset::AddImage ( const eVision::EBaseROI & img,
int originX,
int originY,
int width,
int height,
const eVision::ERegion & mask,
const std::string & label )

Adds an image to the dataset.

The image can be specified by its path on the filesystem (parameter imagePath) or by an eVision image buffer (parameter img).

By default, an image will have no classification label and no segmentation. The label of the image can be directly specified when adding the image to the dataset. If the given label was not in the classification labels of the dataset, it will be automatically added to them.

If no region of interest and/or mask is specified, the region of interest of the image will be its full extent and its mask will be empty.

The method returns the index of the image in the dataset. This index is equal to EDataset::GetNumImages - 1 and can be used to add, remove, or modify the annotations for the image.

Parameters
imgThe image
originXRegion of interest origin abscissa
originYRegion of interest origin ordinate
widthRegion of interest width
heightRegion of interest height
maskThe mask for the image (with respect to the region of interest)
labelThe label

When adding eVision images (EBaseROI) to a dataset, the dataset will retain a copy of the image.

When specifying an individual region of interest and/or mask, the dataset will retain a copy of these.

◆ AddImage() [5/8]

int eVision::EasyDeepLearning::EDataset::AddImage ( const std::string & imagePath)

Adds an image to the dataset.

The image can be specified by its path on the filesystem (parameter imagePath) or by an eVision image buffer (parameter img).

By default, an image will have no classification label and no segmentation. The label of the image can be directly specified when adding the image to the dataset. If the given label was not in the classification labels of the dataset, it will be automatically added to them.

If no region of interest and/or mask is specified, the region of interest of the image will be its full extent and its mask will be empty.

The method returns the index of the image in the dataset. This index is equal to EDataset::GetNumImages - 1 and can be used to add, remove, or modify the annotations for the image.

Parameters
imagePathThe path to an image

When adding eVision images (EBaseROI) to a dataset, the dataset will retain a copy of the image.

When specifying an individual region of interest and/or mask, the dataset will retain a copy of these.

◆ AddImage() [6/8]

int eVision::EasyDeepLearning::EDataset::AddImage ( const std::string & imagePath,
const std::string & label )

Adds an image to the dataset.

The image can be specified by its path on the filesystem (parameter imagePath) or by an eVision image buffer (parameter img).

By default, an image will have no classification label and no segmentation. The label of the image can be directly specified when adding the image to the dataset. If the given label was not in the classification labels of the dataset, it will be automatically added to them.

If no region of interest and/or mask is specified, the region of interest of the image will be its full extent and its mask will be empty.

The method returns the index of the image in the dataset. This index is equal to EDataset::GetNumImages - 1 and can be used to add, remove, or modify the annotations for the image.

Parameters
imagePathThe path to an image
labelThe label

When adding eVision images (EBaseROI) to a dataset, the dataset will retain a copy of the image.

When specifying an individual region of interest and/or mask, the dataset will retain a copy of these.

◆ AddImage() [7/8]

int eVision::EasyDeepLearning::EDataset::AddImage ( const std::string & imagePath,
int originX,
int originY,
int width,
int height,
const eVision::ERegion & mask )

Adds an image to the dataset.

The image can be specified by its path on the filesystem (parameter imagePath) or by an eVision image buffer (parameter img).

By default, an image will have no classification label and no segmentation. The label of the image can be directly specified when adding the image to the dataset. If the given label was not in the classification labels of the dataset, it will be automatically added to them.

If no region of interest and/or mask is specified, the region of interest of the image will be its full extent and its mask will be empty.

The method returns the index of the image in the dataset. This index is equal to EDataset::GetNumImages - 1 and can be used to add, remove, or modify the annotations for the image.

Parameters
imagePathThe path to an image
originXRegion of interest origin abscissa
originYRegion of interest origin ordinate
widthRegion of interest width
heightRegion of interest height
maskThe mask for the image (with respect to the region of interest)

When adding eVision images (EBaseROI) to a dataset, the dataset will retain a copy of the image.

When specifying an individual region of interest and/or mask, the dataset will retain a copy of these.

◆ AddImage() [8/8]

int eVision::EasyDeepLearning::EDataset::AddImage ( const std::string & imagePath,
int originX,
int originY,
int width,
int height,
const eVision::ERegion & mask,
const std::string & label )

Adds an image to the dataset.

The image can be specified by its path on the filesystem (parameter imagePath) or by an eVision image buffer (parameter img).

By default, an image will have no classification label and no segmentation. The label of the image can be directly specified when adding the image to the dataset. If the given label was not in the classification labels of the dataset, it will be automatically added to them.

If no region of interest and/or mask is specified, the region of interest of the image will be its full extent and its mask will be empty.

The method returns the index of the image in the dataset. This index is equal to EDataset::GetNumImages - 1 and can be used to add, remove, or modify the annotations for the image.

Parameters
imagePathThe path to an image
originXRegion of interest origin abscissa
originYRegion of interest origin ordinate
widthRegion of interest width
heightRegion of interest height
maskThe mask for the image (with respect to the region of interest)
labelThe label

When adding eVision images (EBaseROI) to a dataset, the dataset will retain a copy of the image.

When specifying an individual region of interest and/or mask, the dataset will retain a copy of these.

◆ AddImageObject() [1/2]

void eVision::EasyDeepLearning::EDataset::AddImageObject ( int imageIndex,
const eVision::EasyDeepLearning::ELocatorObject & obj )

Adds an object to the image.

Parameters
imageIndexIndex of the image
objObject

The image will be marked as labeled for object detection (EDataset::HasObjectLabeling equals to true) after a call to this method.

The object must be located at least partially within the region of interest of the image. Otherwise, when the object is completely outside of the region of interest, an exception will be thrown.

If the label of the object does not exist in the object labels of the dataset, the label will be added to the object labels of the dataset.

◆ AddImageObject() [2/2]

void eVision::EasyDeepLearning::EDataset::AddImageObject ( int imageIndex,
const std::string & label,
const eVision::ERectangleRegion & box )

Adds an object to the image.

Parameters
imageIndexIndex of the image
labelLabel of the object
boxAxis-aligned rectangle

The image will be marked as labeled for object detection (EDataset::HasObjectLabeling equals to true) after a call to this method.

The object must be located at least partially within the region of interest of the image. Otherwise, when the object is completely outside of the region of interest, an exception will be thrown.

If the label of the object does not exist in the object labels of the dataset, the label will be added to the object labels of the dataset.

◆ AddImages() [1/4]

int eVision::EasyDeepLearning::EDataset::AddImages ( const std::string & filter)

Adds all the images present in the directory specified by the parameter path and whose filename matches the filter.

By default, all the images will have no classification label and no classification. However, a label can be directly specified for all of the images.

The method returns the number of images added to the dataset.

Parameters
filterA glob filter

The filter is a glob pattern. This means the wildcard characters "*" and "?" correspond to "zero or more character" and "a single character" respectively. For example, the filter "*_good_*.png" will match any filename that contains the string "_good_" and has a png extension.

◆ AddImages() [2/4]

int eVision::EasyDeepLearning::EDataset::AddImages ( const std::string & filter,
const std::string & label )

Adds all the images present in the directory specified by the parameter path and whose filename matches the filter.

By default, all the images will have no classification label and no classification. However, a label can be directly specified for all of the images.

The method returns the number of images added to the dataset.

Parameters
filterA glob filter
labelA label.

The filter is a glob pattern. This means the wildcard characters "*" and "?" correspond to "zero or more character" and "a single character" respectively. For example, the filter "*_good_*.png" will match any filename that contains the string "_good_" and has a png extension.

◆ AddImages() [3/4]

int eVision::EasyDeepLearning::EDataset::AddImages ( const std::string & filter,
int originX,
int originY,
int width,
int height,
const eVision::ERegion & mask )

Adds all the images present in the directory specified by the parameter path and whose filename matches the filter.

By default, all the images will have no classification label and no classification. However, a label can be directly specified for all of the images.

The method returns the number of images added to the dataset.

Parameters
filterA glob filter
originXRegion of interest origin abscissa
originYRegion of interest origin ordinate
widthRegion of interest width
heightRegion of interest height
maskThe mask for the images

The filter is a glob pattern. This means the wildcard characters "*" and "?" correspond to "zero or more character" and "a single character" respectively. For example, the filter "*_good_*.png" will match any filename that contains the string "_good_" and has a png extension.

◆ AddImages() [4/4]

int eVision::EasyDeepLearning::EDataset::AddImages ( const std::string & filter,
int originX,
int originY,
int width,
int height,
const eVision::ERegion & mask,
const std::string & label )

Adds all the images present in the directory specified by the parameter path and whose filename matches the filter.

By default, all the images will have no classification label and no classification. However, a label can be directly specified for all of the images.

The method returns the number of images added to the dataset.

Parameters
filterA glob filter
originXRegion of interest origin abscissa
originYRegion of interest origin ordinate
widthRegion of interest width
heightRegion of interest height
maskThe mask for the images
labelA label.

The filter is a glob pattern. This means the wildcard characters "*" and "?" correspond to "zero or more character" and "a single character" respectively. For example, the filter "*_good_*.png" will match any filename that contains the string "_good_" and has a png extension.

◆ AddImagesFromCSV() [1/5]

int eVision::EasyDeepLearning::EDataset::AddImagesFromCSV ( const std::string & csvFile)

Adds images using a CSV (Comma Separated Value) file where each row correspond to an image and the file path and label of each image is given in the columns imageColumn and labelColumn respectively.

If the image path in the CSV file are relative, we use the directory containing the given CSV file as the root of the image paths.

The method returns the number of images added to the dataset.

◆ AddImagesFromCSV() [2/5]

int eVision::EasyDeepLearning::EDataset::AddImagesFromCSV ( const std::string & csvFile,
int imageColumn )

Adds images using a CSV (Comma Separated Value) file where each row correspond to an image and the file path and label of each image is given in the columns imageColumn and labelColumn respectively.

If the image path in the CSV file are relative, we use the directory containing the given CSV file as the root of the image paths.

The method returns the number of images added to the dataset.

◆ AddImagesFromCSV() [3/5]

int eVision::EasyDeepLearning::EDataset::AddImagesFromCSV ( const std::string & csvFile,
int imageColumn,
int labelColumn )

Adds images using a CSV (Comma Separated Value) file where each row correspond to an image and the file path and label of each image is given in the columns imageColumn and labelColumn respectively.

If the image path in the CSV file are relative, we use the directory containing the given CSV file as the root of the image paths.

The method returns the number of images added to the dataset.

◆ AddImagesFromCSV() [4/5]

int eVision::EasyDeepLearning::EDataset::AddImagesFromCSV ( const std::string & csvFile,
int imageColumn,
int labelColumn,
int skipLines )

Adds images using a CSV (Comma Separated Value) file where each row correspond to an image and the file path and label of each image is given in the columns imageColumn and labelColumn respectively.

If the image path in the CSV file are relative, we use the directory containing the given CSV file as the root of the image paths.

The method returns the number of images added to the dataset.

◆ AddImagesFromCSV() [5/5]

int eVision::EasyDeepLearning::EDataset::AddImagesFromCSV ( const std::string & csvFile,
int imageColumn,
int labelColumn,
int skipLines,
const std::string & separator )

Adds images using a CSV (Comma Separated Value) file where each row correspond to an image and the file path and label of each image is given in the columns imageColumn and labelColumn respectively.

If the image path in the CSV file are relative, we use the directory containing the given CSV file as the root of the image paths.

The method returns the number of images added to the dataset.

◆ AddLabel()

void eVision::EasyDeepLearning::EDataset::AddLabel ( const std::string & label)

Adds a label to the dataset.

Parameters
labelName of the new label

◆ AddObjectLabel() [1/2]

void eVision::EasyDeepLearning::EDataset::AddObjectLabel ( const std::string & label)

Adds an object label.

Parameters
labelLabel to add

◆ AddObjectLabel() [2/2]

void eVision::EasyDeepLearning::EDataset::AddObjectLabel ( const std::string & label,
float weight )

Adds an object label.

Parameters
labelLabel to add
weightWeight of the label

◆ AddRegionToSegment() [1/2]

void eVision::EasyDeepLearning::EDataset::AddRegionToSegment ( int imageIndex,
const std::string & label,
const eVision::ERegion & region )

Adds a region (see ERegion) to the given segment of an image. If, before this call, the image had no segmentation, the pixels not in the given region will be set to the background segmentation label.

Parameters
imageIndexImage index
labelSegmentation label
regionRegion to add

◆ AddRegionToSegment() [2/2]

void eVision::EasyDeepLearning::EDataset::AddRegionToSegment ( int imageIndex,
int segmentationLabelIndex,
const eVision::ERegion & region )

Adds a region (see ERegion) to the given segment of an image. If, before this call, the image had no segmentation, the pixels not in the given region will be set to the background segmentation label.

Parameters
imageIndexImage index
segmentationLabelIndexSegmentation label index
regionRegion to add

◆ AddSegmentationLabel() [1/2]

int eVision::EasyDeepLearning::EDataset::AddSegmentationLabel ( const std::string & label)

Adds a segmentation label. The index of the new segmentation labels is returned by the method.

Parameters
labelName of the segmentation label

◆ AddSegmentationLabel() [2/2]

int eVision::EasyDeepLearning::EDataset::AddSegmentationLabel ( const std::string & label,
float labelWeight )

Adds a segmentation label. The index of the new segmentation labels is returned by the method.

Parameters
labelName of the segmentation label
labelWeightWeight of the segmentation label

◆ Clear()

void eVision::EasyDeepLearning::EDataset::Clear ( )
virtual

Clears the dataset.

Reimplemented in eVision::EasyDeepLearning::EClassificationDataset.

◆ Export() [1/12]

void eVision::EasyDeepLearning::EDataset::Export ( const std::string & directory) const

Exports the dataset and its images to the given directory.

  • A new EDataset object with relative paths to the images is saved into the given directory.
  • The exported images will be placed in a sub directory named "Images".

By default, the images will be saved under the filename "Image_[id].[ext]" where [id] is the index of the image in the dataset and [ext] is the image extension. If fileType is set to EImageFileType_Auto, [ext] will be the same as the original image. Otherwise, [ext] will be deduced from the specified file type. If keepFilename is set to true, the images will keep their original filename (except for their extensions). In two images have the same filename, an index will be automatically added to avoid nay conflict. A width, height, and number of channels can be optionally specified to reformat all the images in the dataset. Note that, in this case, only the ROI of the image will be exported.

Parameters
directoryA string containing the full path to the directory.

◆ Export() [2/12]

void eVision::EasyDeepLearning::EDataset::Export ( const std::string & directory,
bool keepFilename ) const

Exports the dataset and its images to the given directory.

  • A new EDataset object with relative paths to the images is saved into the given directory.
  • The exported images will be placed in a sub directory named "Images".

By default, the images will be saved under the filename "Image_[id].[ext]" where [id] is the index of the image in the dataset and [ext] is the image extension. If fileType is set to EImageFileType_Auto, [ext] will be the same as the original image. Otherwise, [ext] will be deduced from the specified file type. If keepFilename is set to true, the images will keep their original filename (except for their extensions). In two images have the same filename, an index will be automatically added to avoid nay conflict. A width, height, and number of channels can be optionally specified to reformat all the images in the dataset. Note that, in this case, only the ROI of the image will be exported.

Parameters
directoryA string containing the full path to the directory.
keepFilenameKeep the original filename of the images

◆ Export() [3/12]

void eVision::EasyDeepLearning::EDataset::Export ( const std::string & directory,
bool keepFilename,
eVision::EImageFileType fileType ) const

Exports the dataset and its images to the given directory.

  • A new EDataset object with relative paths to the images is saved into the given directory.
  • The exported images will be placed in a sub directory named "Images".

By default, the images will be saved under the filename "Image_[id].[ext]" where [id] is the index of the image in the dataset and [ext] is the image extension. If fileType is set to EImageFileType_Auto, [ext] will be the same as the original image. Otherwise, [ext] will be deduced from the specified file type. If keepFilename is set to true, the images will keep their original filename (except for their extensions). In two images have the same filename, an index will be automatically added to avoid nay conflict. A width, height, and number of channels can be optionally specified to reformat all the images in the dataset. Note that, in this case, only the ROI of the image will be exported.

Parameters
directoryA string containing the full path to the directory.
keepFilenameKeep the original filename of the images
fileTypeFile type for the exported file. If EImageFileType_Auto, the same file type as the original image is used.

◆ Export() [4/12]

void eVision::EasyDeepLearning::EDataset::Export ( const std::string & directory,
bool keepFilename,
eVision::EImageFileType fileType,
int quality ) const

Exports the dataset and its images to the given directory.

  • A new EDataset object with relative paths to the images is saved into the given directory.
  • The exported images will be placed in a sub directory named "Images".

By default, the images will be saved under the filename "Image_[id].[ext]" where [id] is the index of the image in the dataset and [ext] is the image extension. If fileType is set to EImageFileType_Auto, [ext] will be the same as the original image. Otherwise, [ext] will be deduced from the specified file type. If keepFilename is set to true, the images will keep their original filename (except for their extensions). In two images have the same filename, an index will be automatically added to avoid nay conflict. A width, height, and number of channels can be optionally specified to reformat all the images in the dataset. Note that, in this case, only the ROI of the image will be exported.

Parameters
directoryA string containing the full path to the directory.
keepFilenameKeep the original filename of the images
fileTypeFile type for the exported file. If EImageFileType_Auto, the same file type as the original image is used.
qualityQuality or compression parameters for EBaseROI::SavePng, EBaseROI::SaveJpeg, or EBaseROI::SaveJpeg2K. A value of -1 means the default value.

◆ Export() [5/12]

void eVision::EasyDeepLearning::EDataset::Export ( const std::string & directory,
eVision::EImageFileType fileType ) const

Exports the dataset and its images to the given directory.

  • A new EDataset object with relative paths to the images is saved into the given directory.
  • The exported images will be placed in a sub directory named "Images".

By default, the images will be saved under the filename "Image_[id].[ext]" where [id] is the index of the image in the dataset and [ext] is the image extension. If fileType is set to EImageFileType_Auto, [ext] will be the same as the original image. Otherwise, [ext] will be deduced from the specified file type. If keepFilename is set to true, the images will keep their original filename (except for their extensions). In two images have the same filename, an index will be automatically added to avoid nay conflict. A width, height, and number of channels can be optionally specified to reformat all the images in the dataset. Note that, in this case, only the ROI of the image will be exported.

Parameters
directoryA string containing the full path to the directory.
fileTypeFile type for the exported file. If EImageFileType_Auto, the same file type as the original image is used.

◆ Export() [6/12]

void eVision::EasyDeepLearning::EDataset::Export ( const std::string & directory,
eVision::EImageFileType fileType,
int quality ) const

Exports the dataset and its images to the given directory.

  • A new EDataset object with relative paths to the images is saved into the given directory.
  • The exported images will be placed in a sub directory named "Images".

By default, the images will be saved under the filename "Image_[id].[ext]" where [id] is the index of the image in the dataset and [ext] is the image extension. If fileType is set to EImageFileType_Auto, [ext] will be the same as the original image. Otherwise, [ext] will be deduced from the specified file type. If keepFilename is set to true, the images will keep their original filename (except for their extensions). In two images have the same filename, an index will be automatically added to avoid nay conflict. A width, height, and number of channels can be optionally specified to reformat all the images in the dataset. Note that, in this case, only the ROI of the image will be exported.

Parameters
directoryA string containing the full path to the directory.
fileTypeFile type for the exported file. If EImageFileType_Auto, the same file type as the original image is used.
qualityQuality or compression parameters for EBaseROI::SavePng, EBaseROI::SaveJpeg, or EBaseROI::SaveJpeg2K. A value of -1 means the default value.

◆ Export() [7/12]

void eVision::EasyDeepLearning::EDataset::Export ( const std::string & directory,
int width,
int height,
int channels ) const

Exports the dataset and its images to the given directory.

  • A new EDataset object with relative paths to the images is saved into the given directory.
  • The exported images will be placed in a sub directory named "Images".

By default, the images will be saved under the filename "Image_[id].[ext]" where [id] is the index of the image in the dataset and [ext] is the image extension. If fileType is set to EImageFileType_Auto, [ext] will be the same as the original image. Otherwise, [ext] will be deduced from the specified file type. If keepFilename is set to true, the images will keep their original filename (except for their extensions). In two images have the same filename, an index will be automatically added to avoid nay conflict. A width, height, and number of channels can be optionally specified to reformat all the images in the dataset. Note that, in this case, only the ROI of the image will be exported.

Parameters
directoryA string containing the full path to the directory.
widthWidth of the image.
heightHeight of the image.
channelsNumber of channels of the image (only 1 and 3 are valid, for grayscale and RGB respectively).

◆ Export() [8/12]

void eVision::EasyDeepLearning::EDataset::Export ( const std::string & directory,
int width,
int height,
int channels,
bool keepFilename ) const

Exports the dataset and its images to the given directory.

  • A new EDataset object with relative paths to the images is saved into the given directory.
  • The exported images will be placed in a sub directory named "Images".

By default, the images will be saved under the filename "Image_[id].[ext]" where [id] is the index of the image in the dataset and [ext] is the image extension. If fileType is set to EImageFileType_Auto, [ext] will be the same as the original image. Otherwise, [ext] will be deduced from the specified file type. If keepFilename is set to true, the images will keep their original filename (except for their extensions). In two images have the same filename, an index will be automatically added to avoid nay conflict. A width, height, and number of channels can be optionally specified to reformat all the images in the dataset. Note that, in this case, only the ROI of the image will be exported.

Parameters
directoryA string containing the full path to the directory.
widthWidth of the image.
heightHeight of the image.
channelsNumber of channels of the image (only 1 and 3 are valid, for grayscale and RGB respectively).
keepFilenameKeep the original filename of the images

◆ Export() [9/12]

void eVision::EasyDeepLearning::EDataset::Export ( const std::string & directory,
int width,
int height,
int channels,
bool keepFilename,
eVision::EImageFileType fileType ) const

Exports the dataset and its images to the given directory.

  • A new EDataset object with relative paths to the images is saved into the given directory.
  • The exported images will be placed in a sub directory named "Images".

By default, the images will be saved under the filename "Image_[id].[ext]" where [id] is the index of the image in the dataset and [ext] is the image extension. If fileType is set to EImageFileType_Auto, [ext] will be the same as the original image. Otherwise, [ext] will be deduced from the specified file type. If keepFilename is set to true, the images will keep their original filename (except for their extensions). In two images have the same filename, an index will be automatically added to avoid nay conflict. A width, height, and number of channels can be optionally specified to reformat all the images in the dataset. Note that, in this case, only the ROI of the image will be exported.

Parameters
directoryA string containing the full path to the directory.
widthWidth of the image.
heightHeight of the image.
channelsNumber of channels of the image (only 1 and 3 are valid, for grayscale and RGB respectively).
keepFilenameKeep the original filename of the images
fileTypeFile type for the exported file. If EImageFileType_Auto, the same file type as the original image is used.

◆ Export() [10/12]

void eVision::EasyDeepLearning::EDataset::Export ( const std::string & directory,
int width,
int height,
int channels,
bool keepFilename,
eVision::EImageFileType fileType,
int quality ) const

Exports the dataset and its images to the given directory.

  • A new EDataset object with relative paths to the images is saved into the given directory.
  • The exported images will be placed in a sub directory named "Images".

By default, the images will be saved under the filename "Image_[id].[ext]" where [id] is the index of the image in the dataset and [ext] is the image extension. If fileType is set to EImageFileType_Auto, [ext] will be the same as the original image. Otherwise, [ext] will be deduced from the specified file type. If keepFilename is set to true, the images will keep their original filename (except for their extensions). In two images have the same filename, an index will be automatically added to avoid nay conflict. A width, height, and number of channels can be optionally specified to reformat all the images in the dataset. Note that, in this case, only the ROI of the image will be exported.

Parameters
directoryA string containing the full path to the directory.
widthWidth of the image.
heightHeight of the image.
channelsNumber of channels of the image (only 1 and 3 are valid, for grayscale and RGB respectively).
keepFilenameKeep the original filename of the images
fileTypeFile type for the exported file. If EImageFileType_Auto, the same file type as the original image is used.
qualityQuality or compression parameters for EBaseROI::SavePng, EBaseROI::SaveJpeg, or EBaseROI::SaveJpeg2K. A value of -1 means the default value.

◆ Export() [11/12]

void eVision::EasyDeepLearning::EDataset::Export ( const std::string & directory,
int width,
int height,
int channels,
eVision::EImageFileType fileType ) const

Exports the dataset and its images to the given directory.

  • A new EDataset object with relative paths to the images is saved into the given directory.
  • The exported images will be placed in a sub directory named "Images".

By default, the images will be saved under the filename "Image_[id].[ext]" where [id] is the index of the image in the dataset and [ext] is the image extension. If fileType is set to EImageFileType_Auto, [ext] will be the same as the original image. Otherwise, [ext] will be deduced from the specified file type. If keepFilename is set to true, the images will keep their original filename (except for their extensions). In two images have the same filename, an index will be automatically added to avoid nay conflict. A width, height, and number of channels can be optionally specified to reformat all the images in the dataset. Note that, in this case, only the ROI of the image will be exported.

Parameters
directoryA string containing the full path to the directory.
widthWidth of the image.
heightHeight of the image.
channelsNumber of channels of the image (only 1 and 3 are valid, for grayscale and RGB respectively).
fileTypeFile type for the exported file. If EImageFileType_Auto, the same file type as the original image is used.

◆ Export() [12/12]

void eVision::EasyDeepLearning::EDataset::Export ( const std::string & directory,
int width,
int height,
int channels,
eVision::EImageFileType fileType,
int quality ) const

Exports the dataset and its images to the given directory.

  • A new EDataset object with relative paths to the images is saved into the given directory.
  • The exported images will be placed in a sub directory named "Images".

By default, the images will be saved under the filename "Image_[id].[ext]" where [id] is the index of the image in the dataset and [ext] is the image extension. If fileType is set to EImageFileType_Auto, [ext] will be the same as the original image. Otherwise, [ext] will be deduced from the specified file type. If keepFilename is set to true, the images will keep their original filename (except for their extensions). In two images have the same filename, an index will be automatically added to avoid nay conflict. A width, height, and number of channels can be optionally specified to reformat all the images in the dataset. Note that, in this case, only the ROI of the image will be exported.

Parameters
directoryA string containing the full path to the directory.
widthWidth of the image.
heightHeight of the image.
channelsNumber of channels of the image (only 1 and 3 are valid, for grayscale and RGB respectively).
fileTypeFile type for the exported file. If EImageFileType_Auto, the same file type as the original image is used.
qualityQuality or compression parameters for EBaseROI::SavePng, EBaseROI::SaveJpeg, or EBaseROI::SaveJpeg2K. A value of -1 means the default value.

◆ ExtractSplit()

eVision::EasyDeepLearning::EDataset eVision::EasyDeepLearning::EDataset::ExtractSplit ( const eVision::EasyDeepLearning::EDatasetSplit & split,
eVision::EasyDeepLearning::EDatasetType type ) const

Creates a new EDataset containing only the images of the given split type.

Parameters
splitSplit
typeType of the split to extract

◆ GetAbsoluteMaxOverlap()

float eVision::EasyDeepLearning::EDataset::GetAbsoluteMaxOverlap ( ) const

Absolute maximum overlap between objects in the dataset.

◆ GetAvailableImageAnnotationFormat() [1/2]

eVision::EasyDeepLearning::EImageAnnotationFormat eVision::EasyDeepLearning::EDataset::GetAvailableImageAnnotationFormat ( const std::string & imageFile) const

Image annotation file formats that are available next to the image file.

Parameters
imageFilePath to an image file

◆ GetAvailableImageAnnotationFormat() [2/2]

eVision::EasyDeepLearning::EImageAnnotationFormat eVision::EasyDeepLearning::EDataset::GetAvailableImageAnnotationFormat ( int imgId) const

Image annotation file formats that are available next to the image file.

Parameters
imgIdIndex of an image

◆ GetChannels()

uint32_t eVision::EasyDeepLearning::EDataset::GetChannels ( ) const

Number of channels of the first image added to the dataset.

◆ GetHeight()

uint32_t eVision::EasyDeepLearning::EDataset::GetHeight ( ) const

Height of the region of interest of the first image added to the dataset.

◆ GetImageCopy() [1/2]

std::unique_ptr< eVision::EBaseROI > eVision::EasyDeepLearning::EDataset::GetImageCopy ( int index) const

Gets a copy of the i-th image of the dataset.

Parameters
indexThe index of the image.

◆ GetImageCopy() [2/2]

void eVision::EasyDeepLearning::EDataset::GetImageCopy ( int index,
eVision::EBaseROI & img ) const

Gets a copy of the i-th image of the dataset.

Parameters
indexThe index of the image.
imgImage object to copy the image into.

◆ GetImageLabel()

std::string eVision::EasyDeepLearning::EDataset::GetImageLabel ( int index) const

Gets the label of the i-th image of the dataset. An exception is thrown if the image has no classification label.

Parameters
indexThe index of the image for which to get the label.

◆ GetImageNumObjects()

int eVision::EasyDeepLearning::EDataset::GetImageNumObjects ( int imageIndex) const

Number of objects for the specified image.

Parameters
imageIndexIndex of the image

◆ GetImageObject()

eVision::EasyDeepLearning::ELocatorObject eVision::EasyDeepLearning::EDataset::GetImageObject ( int imageIndex,
int objectIndex ) const

Gets the specified object for the given image.

Parameters
imageIndexIndex of the image
objectIndexIndex of the object between 0 and EDataset::GetImageNumObjects

◆ GetImageObjects()

std::vector< eVision::EasyDeepLearning::ELocatorObject > eVision::EasyDeepLearning::EDataset::GetImageObjects ( int imageIndex) const

Gets all the objects of the specified image.

Parameters
imageIndexIndex of the image

◆ GetImagePath()

std::string eVision::EasyDeepLearning::EDataset::GetImagePath ( int index) const

Gets the path of the i-th image of the dataset. If the image was not given using a path, the method will throw an exception.

Parameters
indexThe index of the image for which to get the path.

◆ GetImagesIndexesWithLabel() [1/2]

std::vector< uint32_t > eVision::EasyDeepLearning::EDataset::GetImagesIndexesWithLabel ( const std::string & label) const

Gets a list of index corresponding to the images associated with the given label.

Parameters
labelThe label

◆ GetImagesIndexesWithLabel() [2/2]

std::vector< uint32_t > eVision::EasyDeepLearning::EDataset::GetImagesIndexesWithLabel ( int labelIndex) const

Gets a list of index corresponding to the images associated with the given label.

Parameters
labelIndexThe index of the label (starting from 0 to EDataset::GetNumLabels - 1)

◆ GetImagesIndexesWithNoLabel()

std::vector< int > eVision::EasyDeepLearning::EDataset::GetImagesIndexesWithNoLabel ( ) const

Gets a list of index corresponding to the images with no classification labels.

◆ GetLabel()

std::string eVision::EasyDeepLearning::EDataset::GetLabel ( int i) const

Gets the i-th label of the dataset (starting from 0 to EDataset::GetNumLabels - 1).

Parameters
iLabel index

◆ GetLabelColor()

eVision::ERGBColor eVision::EasyDeepLearning::EDataset::GetLabelColor ( int index) const

Gets the label color for a classification label.

Parameters
indexLabel index (0 to EDataset::GetNumLabels - 1).

◆ GetLabeledImagesIndexes()

std::vector< int > eVision::EasyDeepLearning::EDataset::GetLabeledImagesIndexes ( ) const

Gets a list of index corresponding to the images that have a classification label.

◆ GetLabelOpacity()

uint8_t eVision::EasyDeepLearning::EDataset::GetLabelOpacity ( int index) const

Gets the label opacity for a classification label.

Parameters
indexLabel index (0 to EDataset::GetNumLabels - 1).

◆ GetLabelWeight()

float eVision::EasyDeepLearning::EDataset::GetLabelWeight ( int index) const

Gets the weight associated to the i-th label of the dataset (starting from 0 to EDataset::GetNumLabels - 1).

Parameters
indexLabel index

◆ GetMask()

eVision::ERegion eVision::EasyDeepLearning::EDataset::GetMask ( int imageIndex) const

Gets the mask region/don't care area for the given image. The mask is defined with respect to the region of interest of the image.

Parameters
imageIndexIndex of the image for which to get the mask region

◆ GetMaxNumObjectPerImage()

int eVision::EasyDeepLearning::EDataset::GetMaxNumObjectPerImage ( ) const

Maximum number of objects for an image in the dataset. If no images has object labeling (see EDataset::HasObjectLabeling), the method returns -1.

◆ GetNumImageFiles()

int eVision::EasyDeepLearning::EDataset::GetNumImageFiles ( ) const

Number of different image files contained in the dataset.

The number of image files can be different than the number of images of the dataset. An image file can correspond to several dataset images (with different ROI).

◆ GetNumImages()

int eVision::EasyDeepLearning::EDataset::GetNumImages ( ) const

Number of images in the dataset.

◆ GetNumImagesForFile()

int eVision::EasyDeepLearning::EDataset::GetNumImagesForFile ( const std::string & filePath) const

Get the number of images in the dataset that are associated with the given image file.

Parameters
filePaththe path to the image.

The number of image files can be different than the number of images of the dataset. An image file can correspond to several dataset images (with different ROI).

◆ GetNumImagesForSegmentationLabel() [1/2]

int eVision::EasyDeepLearning::EDataset::GetNumImagesForSegmentationLabel ( const std::string & label) const

Number of images containing the given segmentation label.

Parameters
labelSegmentation label

◆ GetNumImagesForSegmentationLabel() [2/2]

int eVision::EasyDeepLearning::EDataset::GetNumImagesForSegmentationLabel ( int labelId) const

Number of images containing the given segmentation label.

Parameters
labelIdIndex of the segmentation label

◆ GetNumImagesWithForegroundSegments()

int eVision::EasyDeepLearning::EDataset::GetNumImagesWithForegroundSegments ( ) const

Number of images that have a ground truth segmentation that has foreground segments and is this not entirely composed of background pixels.

◆ GetNumImagesWithObjectLabel() [1/2]

int eVision::EasyDeepLearning::EDataset::GetNumImagesWithObjectLabel ( const std::string & label) const

Number of images that contain an object with the given label.

Parameters
labelLabel.

◆ GetNumImagesWithObjectLabel() [2/2]

int eVision::EasyDeepLearning::EDataset::GetNumImagesWithObjectLabel ( int labelIdx) const

Number of images that contain an object with the given label.

Parameters
labelIdxIndex of the object label.

◆ GetNumImagesWithObjectLabeling()

int eVision::EasyDeepLearning::EDataset::GetNumImagesWithObjectLabeling ( ) const

Number of images in the dataset that are labeled for object detection.

◆ GetNumImagesWithObjects()

int eVision::EasyDeepLearning::EDataset::GetNumImagesWithObjects ( ) const

Number of images in the dataset that are labeled for object detection and have 1 or more objects.

◆ GetNumImagesWithOCR()

int eVision::EasyDeepLearning::EDataset::GetNumImagesWithOCR ( ) const

Number of images with OCR annotations.

◆ GetNumImagesWithoutForegroundSegments()

int eVision::EasyDeepLearning::EDataset::GetNumImagesWithoutForegroundSegments ( ) const

Number of images that have a ground truth segmentation that has no foreground segments and is thus entirely composed of background pixels.

◆ GetNumImagesWithoutObjectLabeling()

int eVision::EasyDeepLearning::EDataset::GetNumImagesWithoutObjectLabeling ( ) const

Number of images in the dataset that are not labeled for object detection.

◆ GetNumImagesWithoutObjects()

int eVision::EasyDeepLearning::EDataset::GetNumImagesWithoutObjects ( ) const

Number of images in the dataset that are labeled for object detection but have been associated with no object.

◆ GetNumImagesWithoutOCR()

int eVision::EasyDeepLearning::EDataset::GetNumImagesWithoutOCR ( ) const

Number of images without OCR annotations.

◆ GetNumImagesWithoutSegmentation()

int eVision::EasyDeepLearning::EDataset::GetNumImagesWithoutSegmentation ( ) const

Number of images that doesn't have a ground truth segmentation.

◆ GetNumImagesWithSegmentation()

int eVision::EasyDeepLearning::EDataset::GetNumImagesWithSegmentation ( ) const

Number of images that have a ground truth segmentation.

◆ GetNumLabeledImages()

int eVision::EasyDeepLearning::EDataset::GetNumLabeledImages ( ) const

Number of images that have a classification label.

◆ GetNumLabels()

int eVision::EasyDeepLearning::EDataset::GetNumLabels ( ) const

Number of labels in the dataset.

◆ GetNumObjectLabels()

int eVision::EasyDeepLearning::EDataset::GetNumObjectLabels ( ) const

Number of object labels.

◆ GetNumObjectsWithLabel() [1/2]

uint64_t eVision::EasyDeepLearning::EDataset::GetNumObjectsWithLabel ( const std::string & label) const

Number of objects with the given label.

Parameters
labelLabel.

◆ GetNumObjectsWithLabel() [2/2]

uint64_t eVision::EasyDeepLearning::EDataset::GetNumObjectsWithLabel ( int labelIdx) const

Number of objects with the given label.

Parameters
labelIdxIndex of the object label.

◆ GetNumPixelsForSegmentationLabel() [1/2]

uint64_t eVision::EasyDeepLearning::EDataset::GetNumPixelsForSegmentationLabel ( const std::string & label) const

Number of pixels assigned to the given segmentation label.

Parameters
labelSegmentation label

◆ GetNumPixelsForSegmentationLabel() [2/2]

uint64_t eVision::EasyDeepLearning::EDataset::GetNumPixelsForSegmentationLabel ( int labelId) const

Number of pixels assigned to the given segmentation label.

Parameters
labelIdIndex of the segmentation label

◆ GetNumSegmentationLabels()

int eVision::EasyDeepLearning::EDataset::GetNumSegmentationLabels ( ) const

Number of segmentation labels. A dataset has always at least one segmentation label: "background".

◆ GetNumSegmentedBlobs() [1/3]

int eVision::EasyDeepLearning::EDataset::GetNumSegmentedBlobs ( int imageId) const

Number of segmented blobs in the image for all non-background labels or for a specific label.

Parameters
imageIdImage index

A segmented blob is a contiguous area assigned to a label different than "Background".

◆ GetNumSegmentedBlobs() [2/3]

int eVision::EasyDeepLearning::EDataset::GetNumSegmentedBlobs ( int imageId,
const std::string & label ) const

Number of segmented blobs in the image for all non-background labels or for a specific label.

Parameters
imageIdImage index
labelLabel

A segmented blob is a contiguous area assigned to a label different than "Background".

◆ GetNumSegmentedBlobs() [3/3]

int eVision::EasyDeepLearning::EDataset::GetNumSegmentedBlobs ( int imageId,
int labelId ) const

Number of segmented blobs in the image for all non-background labels or for a specific label.

Parameters
imageIdImage index
labelIdLabel index

A segmented blob is a contiguous area assigned to a label different than "Background".

◆ GetNumTexts()

int eVision::EasyDeepLearning::EDataset::GetNumTexts ( ) const

Number of annotated texts in the dataset.

◆ GetNumUnlabeledImages()

int eVision::EasyDeepLearning::EDataset::GetNumUnlabeledImages ( ) const

Number of images that doesn't have any classification label.

◆ GetObjectLabel()

std::string eVision::EasyDeepLearning::EDataset::GetObjectLabel ( int labelIndex) const

Object label.

Parameters
labelIndexIndex of the object label between 0 and EDataset::GetNumObjectLabels

◆ GetObjectLabelColor()

eVision::ERGBColor eVision::EasyDeepLearning::EDataset::GetObjectLabelColor ( int index) const

Gets the label color for an object label.

Parameters
indexLabel index (0 to EDataset::GetNumLabels - 1).

◆ GetObjectLabelOpacity()

uint8_t eVision::EasyDeepLearning::EDataset::GetObjectLabelOpacity ( int index) const

Gets the label opacity for an object label.

Parameters
indexLabel index (0 to EDataset::GetNumLabels - 1).

◆ GetObjectLabelWeight() [1/2]

float eVision::EasyDeepLearning::EDataset::GetObjectLabelWeight ( const std::string & label) const

Gets the weight of an object label.

Parameters
labelLabel

◆ GetObjectLabelWeight() [2/2]

float eVision::EasyDeepLearning::EDataset::GetObjectLabelWeight ( int labelIndex) const

Gets the weight of an object label.

Parameters
labelIndexIndex of the object label

◆ GetObjectSize()

int eVision::EasyDeepLearning::EDataset::GetObjectSize ( ) const

Object size for EasyLocate Interest point.

◆ GetOCRAnnotations()

std::vector< eVision::EasyDeepOCR::ETextLine > eVision::EasyDeepLearning::EDataset::GetOCRAnnotations ( int imgId) const

Ground truth text lines for the specified image.

Parameters
imgIdIndex of the image.

◆ GetRegionForSegment() [1/2]

eVision::ERegion eVision::EasyDeepLearning::EDataset::GetRegionForSegment ( int imageIndex,
const std::string & segmentationLabel )

Gets a region corresponding to the pixels of the given segment.

Parameters
imageIndexImage index
segmentationLabelSegmentation label

◆ GetRegionForSegment() [2/2]

eVision::ERegion eVision::EasyDeepLearning::EDataset::GetRegionForSegment ( int imageIndex,
int segmentationLabelIndex )

Gets a region corresponding to the pixels of the given segment.

Parameters
imageIndexImage index
segmentationLabelIndexSegmentation label index

◆ GetRegionOfInterestHeight()

int eVision::EasyDeepLearning::EDataset::GetRegionOfInterestHeight ( int imageIndex) const

Region of interest height for the specified image.

Parameters
imageIndexIndex of the image.

◆ GetRegionOfInterestOriginX()

int eVision::EasyDeepLearning::EDataset::GetRegionOfInterestOriginX ( int imageIndex) const

Region of interest origin abscissa for the specified image.

Parameters
imageIndexIndex of the image.

◆ GetRegionOfInterestOriginY()

int eVision::EasyDeepLearning::EDataset::GetRegionOfInterestOriginY ( int imageIndex) const

Region of interest origin ordinate for the specified image.

Parameters
imageIndexIndex of the image.

◆ GetRegionOfInterestWidth()

int eVision::EasyDeepLearning::EDataset::GetRegionOfInterestWidth ( int imageIndex) const

Region of interest width for the specified image.

Parameters
imageIndexIndex of the image.

◆ GetSameLabelMaxOverlap()

float eVision::EasyDeepLearning::EDataset::GetSameLabelMaxOverlap ( ) const

Maximum overlap between objects with the same label in the dataset.

◆ GetSegmentationLabel()

std::string eVision::EasyDeepLearning::EDataset::GetSegmentationLabel ( int index) const

Gets the segmentation label.

Parameters
indexIndex of the segmentation label

The segmentation label index 0 is reserved and corresponds to the "background" label. This segmentation label can't be changed.

◆ GetSegmentationLabelColor()

eVision::ERGBColor eVision::EasyDeepLearning::EDataset::GetSegmentationLabelColor ( int index) const

Gets the label color for a segmentation label.

Parameters
indexLabel index (0 to EDataset::GetNumLabels - 1).

◆ GetSegmentationLabelOpacity()

uint8_t eVision::EasyDeepLearning::EDataset::GetSegmentationLabelOpacity ( int index) const

Gets the label opacity for a segmentation label.

Parameters
indexLabel index (0 to EDataset::GetNumLabels - 1).

◆ GetSegmentationLabelWeight() [1/2]

float eVision::EasyDeepLearning::EDataset::GetSegmentationLabelWeight ( const std::string & label) const

Gets the segmentation label weights.

Parameters
labelSegmentation label

◆ GetSegmentationLabelWeight() [2/2]

float eVision::EasyDeepLearning::EDataset::GetSegmentationLabelWeight ( int index) const

Gets the segmentation label weights.

Parameters
indexIndex of the segmentation label

◆ GetSegmentationMap()

eVision::EImageBW16 eVision::EasyDeepLearning::EDataset::GetSegmentationMap ( int imageIndex) const

Gets the segmentation map of an image. The segmentation map is a 16-bit EROIBW16 image where the value of each pixel is equal to the corresponding segmentation label index (see EDataset::GetSegmentationLabel).

If an image has no segmentation (EDataset::HasSegmentation), the getter will throw an exception.

Parameters
imageIndexImage index

◆ GetSplit() [1/4]

eVision::EasyDeepLearning::EDatasetSplit eVision::EasyDeepLearning::EDataset::GetSplit ( float trainingProportion,
float validationPropotion,
eVision::EasyDeepLearning::EDeepLearningToolType toolType,
const std::string & goodLabel ) const

Generates a split.

Parameters
trainingProportionApproximate proportion of training images
validationPropotionApproximate proportion of validation images
toolTypeTool type for which to generate the split
goodLabelThe good label for EasySegment Unsupervised split

◆ GetSplit() [2/4]

eVision::EasyDeepLearning::EDatasetSplit eVision::EasyDeepLearning::EDataset::GetSplit ( float trainingProportion,
float validationPropotion,
eVision::EasyDeepLearning::EDeepLearningToolType toolType,
const std::string & goodLabel,
uint32_t seed ) const

Generates a split.

Parameters
trainingProportionApproximate proportion of training images
validationPropotionApproximate proportion of validation images
toolTypeTool type for which to generate the split
goodLabelThe good label for EasySegment Unsupervised split
seedSeed for randomization

◆ GetSplit() [3/4]

eVision::EasyDeepLearning::EDatasetSplit eVision::EasyDeepLearning::EDataset::GetSplit ( int numTrainingImages,
int numValidationImages,
eVision::EasyDeepLearning::EDeepLearningToolType toolType,
const std::string & goodLabel ) const

Generates a split.

Parameters
numTrainingImagesNumber of training images
numValidationImagesNumber of validation images
toolTypeTool type for which to generate the split
goodLabelThe good label for EasySegment Unsupervised split

◆ GetSplit() [4/4]

eVision::EasyDeepLearning::EDatasetSplit eVision::EasyDeepLearning::EDataset::GetSplit ( int numTrainingImages,
int numValidationImages,
eVision::EasyDeepLearning::EDeepLearningToolType toolType,
const std::string & goodLabel,
uint32_t seed ) const

Generates a split.

Parameters
numTrainingImagesNumber of training images
numValidationImagesNumber of validation images
toolTypeTool type for which to generate the split
goodLabelThe good label for EasySegment Unsupervised split
seedSeed for randomization

◆ GetTextDataset()

eVision::EasyDeepLearning::EDataset eVision::EasyDeepLearning::EDataset::GetTextDataset ( ) const

Transforms the current dataset to have only subwindow containing the actual text to read.

◆ GetTextLabeledImagesIndexes()

std::vector< int > eVision::EasyDeepLearning::EDataset::GetTextLabeledImagesIndexes ( ) const

Gets a list of index corresponding to the images that have a text only label.

◆ GetTextOrientationDataset()

eVision::EasyDeepLearning::EDataset eVision::EasyDeepLearning::EDataset::GetTextOrientationDataset ( ) const

Transforms the current text dataset to duplicate it with half image flipped, adding corresponding ground truth.

◆ GetWidth()

uint32_t eVision::EasyDeepLearning::EDataset::GetWidth ( ) const

Width of the region of interest of the first image added to the dataset.

◆ HasForegroundSegments()

bool eVision::EasyDeepLearning::EDataset::HasForegroundSegments ( int imageId) const

Whether the image segmentation contains segments that are not background. If the image has no segmentation, this method throws an exception.

Parameters
imageIdImage index

◆ HasLabel()

bool eVision::EasyDeepLearning::EDataset::HasLabel ( int index) const

Whether an image has a classification label.

Parameters
indexIndex of an image.

◆ HasObjectLabeling()

bool eVision::EasyDeepLearning::EDataset::HasObjectLabeling ( int imageIndex) const

Whether the image is labeled for object detection and use with ELocator.

Parameters
imageIndexIndex of the image

◆ HasOCRAnnotations()

bool eVision::EasyDeepLearning::EDataset::HasOCRAnnotations ( int imgId) const

Whether the specified image has OCR annotations.

Parameters
imgIdIndex of the image.

◆ HasSegmentation()

bool eVision::EasyDeepLearning::EDataset::HasSegmentation ( int imageId) const

Whether the image has a segmentation.

Parameters
imageIdImage index

◆ ImportPascalVOCXMLAnnotations() [1/2]

void eVision::EasyDeepLearning::EDataset::ImportPascalVOCXMLAnnotations ( )

Imports Pascal VOC XML annotations (for EasyLocate Bounding Box).

This method may add new labels to the object labels.

The version that do not take an image index attempts to import the annotation from all images currently in the dataset.

◆ ImportPascalVOCXMLAnnotations() [2/2]

void eVision::EasyDeepLearning::EDataset::ImportPascalVOCXMLAnnotations ( int imgId)

Imports Pascal VOC XML annotations (for EasyLocate Bounding Box).

This method may add new labels to the object labels.

The version that do not take an image index attempts to import the annotation from all images currently in the dataset.

Parameters
imgIdThe image index for which to import the annotation

◆ ImportYOLOTXTAnnotations() [1/2]

void eVision::EasyDeepLearning::EDataset::ImportYOLOTXTAnnotations ( const std::string & labelFile)

Imports YOLO TXT annotations (for EasyLocate Bounding Box).

You need to specify the list of labels associated with the YOLO TXT annotations through an array of string or through a file containing this list. This method may add new labels to the object labels.

The version that do not take an image index attempts to import the annotation from all images currently in the dataset.

Parameters
labelFilePath to a file containing the label list

◆ ImportYOLOTXTAnnotations() [2/2]

void eVision::EasyDeepLearning::EDataset::ImportYOLOTXTAnnotations ( int imgId,
const std::string & labelFile )

Imports YOLO TXT annotations (for EasyLocate Bounding Box).

You need to specify the list of labels associated with the YOLO TXT annotations through an array of string or through a file containing this list. This method may add new labels to the object labels.

The version that do not take an image index attempts to import the annotation from all images currently in the dataset.

Parameters
imgIdThe image index for which to import the annotation
labelFilePath to a file containing the label list

◆ IsEmbeddedImage()

bool eVision::EasyDeepLearning::EDataset::IsEmbeddedImage ( int index) const

Whether the image is embedded into the dataset and is not a reference towards an image file.

Parameters
indexIndex of the image.

◆ IsImageFile()

bool eVision::EasyDeepLearning::EDataset::IsImageFile ( int index) const

Whether the image is stored as a file path towards an image.

Parameters
indexIndex of the image.

◆ Load() [1/2]

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

Loads a classification dataset from disk.

Parameters
pathA string containing the full path to the dataset file.

◆ Load() [2/2]

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

Loads a classification dataset from disk.

Parameters
serializerThe serializer.

◆ operator=()

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

Assignment operator.

Parameters
otherReference to the EDataset object used for the assignment

◆ RemoveImage()

void eVision::EasyDeepLearning::EDataset::RemoveImage ( int imgId)

Removes the image at the given index. All annotations (label, segmentation, objects) will be lost.

Parameters
imgIdIndex of the image to remove

◆ RemoveImageObject()

void eVision::EasyDeepLearning::EDataset::RemoveImageObject ( int imageIndex,
int objectIndex )

Removes an object from an image.

Parameters
imageIndexIndex of the image
objectIndexIndex of the object between 0 and EDataset::GetImageNumObjects

◆ RemoveLabel() [1/2]

void eVision::EasyDeepLearning::EDataset::RemoveLabel ( const std::string & label)

Removes a label from the dataset.

All the images associated with this label will be set to unlabeled (see EDataset::HasLabel).

Parameters
labelName of the label to remove

◆ RemoveLabel() [2/2]

void eVision::EasyDeepLearning::EDataset::RemoveLabel ( int labelId)

Removes a label from the dataset.

All the images associated with this label will be set to unlabeled (see EDataset::HasLabel).

Parameters
labelIdIndex of the label to remove

◆ RemoveObjectLabel() [1/2]

void eVision::EasyDeepLearning::EDataset::RemoveObjectLabel ( const std::string & label)

Removes an object label.

Parameters
labelLabel to remove

◆ RemoveObjectLabel() [2/2]

void eVision::EasyDeepLearning::EDataset::RemoveObjectLabel ( int labelIndex)

Removes an object label.

Parameters
labelIndexIndex of the object label to remove

◆ RemoveSegmentationLabel() [1/2]

void eVision::EasyDeepLearning::EDataset::RemoveSegmentationLabel ( const std::string & label)

Remove a segmentation label.

This method sets all the pixels in the dataset assigned to this label to the background label.

Parameters
labelName of the segmentation label to remove

◆ RemoveSegmentationLabel() [2/2]

void eVision::EasyDeepLearning::EDataset::RemoveSegmentationLabel ( int index)

Remove a segmentation label.

This method sets all the pixels in the dataset assigned to this label to the background label.

Parameters
indexIndex of the segmentation label to remove

◆ ResetImageObjectLabeling()

void eVision::EasyDeepLearning::EDataset::ResetImageObjectLabeling ( int imageIndex)

Resets the object labeling for the specified image. This sets the image as having been labeled for object detection with no object present in the image.

Parameters
imageIndexIndex of the image

◆ ResetSegmentation()

void eVision::EasyDeepLearning::EDataset::ResetSegmentation ( int imageIndex)

Resets the segmentation of an image by setting all pixels to background.

Parameters
imageIndexImage index

◆ Save() [1/2]

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

Saves a classification dataset to disk, containing the file paths to the images in the dataset and their associated label.

Parameters
pathA string containing the full path to the dataset file.

This method only save the image that were given to this EDataset instance as EBaseROI pointers.

To obtain a portable EDataset file, please use EDataset::Export.

◆ Save() [2/2]

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

Saves a classification dataset to disk, containing the file paths to the images in the dataset and their associated label.

Parameters
serializerThe serializer.

This method only save the image that were given to this EDataset instance as EBaseROI pointers.

To obtain a portable EDataset file, please use EDataset::Export.

◆ SaveWithRelativePath()

void eVision::EasyDeepLearning::EDataset::SaveWithRelativePath ( const std::string & path)

Saves the dataset with image paths relative to the directory in which the dataset file is saved.

◆ SetBasePath()

void eVision::EasyDeepLearning::EDataset::SetBasePath ( const std::string & basePath)

Sets the base path for the images specified with a relative path.

Parameters
basePathBase path

The base path is not serialized. It must be set after loading a dataset file.

◆ SetImageLabel() [1/2]

void eVision::EasyDeepLearning::EDataset::SetImageLabel ( const std::string & filter,
const std::string & label )

Sets the label of images in the dataset.

Parameters
filterA glob filter
labelThe label

The filter is a glob pattern. This means the wildcard characters "*" and "?" correspond to "zero or more character" and "a single character" respectively. For example, the filter "*_good_*.png" will match any filename that contains the string "_good_" and has a png extension.

◆ SetImageLabel() [2/2]

void eVision::EasyDeepLearning::EDataset::SetImageLabel ( int index,
const std::string & label )

Sets the label of images in the dataset.

Parameters
indexThe index of the image for which to set the label.
labelThe label

The filter is a glob pattern. This means the wildcard characters "*" and "?" correspond to "zero or more character" and "a single character" respectively. For example, the filter "*_good_*.png" will match any filename that contains the string "_good_" and has a png extension.

◆ SetImageObject() [1/3]

void eVision::EasyDeepLearning::EDataset::SetImageObject ( int imageIndex,
int objectIndex,
const eVision::EasyDeepLearning::ELocatorObject & obj )

Sets the specified object for the given image.

Parameters
imageIndexIndex of the image
objectIndexIndex of the object between 0 and EDataset::GetImageNumObjects
objObject

If the label of the object does not exist in the object labels of the dataset, the label will be added to the object labels of the dataset.

◆ SetImageObject() [2/3]

void eVision::EasyDeepLearning::EDataset::SetImageObject ( int imageIndex,
int objectIndex,
const eVision::ERectangleRegion & region )

Sets the specified object for the given image.

Parameters
imageIndexIndex of the image
objectIndexIndex of the object between 0 and EDataset::GetImageNumObjects
regionNew region for the object

If the label of the object does not exist in the object labels of the dataset, the label will be added to the object labels of the dataset.

◆ SetImageObject() [3/3]

void eVision::EasyDeepLearning::EDataset::SetImageObject ( int imageIndex,
int objectIndex,
const std::string & label )

Sets the specified object for the given image.

Parameters
imageIndexIndex of the image
objectIndexIndex of the object between 0 and EDataset::GetImageNumObjects
labelNew label for the object

If the label of the object does not exist in the object labels of the dataset, the label will be added to the object labels of the dataset.

◆ SetLabel()

void eVision::EasyDeepLearning::EDataset::SetLabel ( int index,
const std::string & label )

Sets the i-th label of the dataset (starting from 0 to EDataset::GetNumLabels - 1). This operation does not add a new label to the dataset but simply renames an existing label.

Parameters
indexLabel index
labelReplacement label

◆ SetLabelColor()

void eVision::EasyDeepLearning::EDataset::SetLabelColor ( int index,
const eVision::ERGBColor & color )

Sets the label color for a classification label.

Parameters
indexLabel index (0 to EDataset::GetNumLabels - 1).
colorNew color for the label

◆ SetLabelOpacity()

void eVision::EasyDeepLearning::EDataset::SetLabelOpacity ( int index,
const uint8_t opacity )

Sets the label opacity for a classification label.

Parameters
indexLabel index (0 to EDataset::GetNumLabels - 1).
opacityNew opacity for the label

◆ SetLabelWeight()

void eVision::EasyDeepLearning::EDataset::SetLabelWeight ( int index,
const float & weight )

Sets the weight associated to the i-th label of the dataset (starting from 0 to EDataset::GetNumLabels - 1). This operation does not add a new label.

Parameters
indexLabel index
weightWeight to be set

◆ SetMask()

void eVision::EasyDeepLearning::EDataset::SetMask ( int imageIndex,
const eVision::ERegion & mask )

Sets the mask region/don't care area for the given image. The mask is defined with respect to the region of interest of the image.

Parameters
imageIndexIndex of the image for which to get the mask region
maskMask to set on the image

◆ SetObjectLabel() [1/2]

void eVision::EasyDeepLearning::EDataset::SetObjectLabel ( const std::string & oldLabel,
const std::string & newLabel )

Sets an object label.

Parameters
oldLabelOld label to change
newLabelNew label to be set

◆ SetObjectLabel() [2/2]

void eVision::EasyDeepLearning::EDataset::SetObjectLabel ( int labelIndex,
const std::string & newLabel )

Sets an object label.

Parameters
labelIndexIndex of the object label
newLabelNew label to be set

◆ SetObjectLabelColor()

void eVision::EasyDeepLearning::EDataset::SetObjectLabelColor ( int index,
const eVision::ERGBColor & color )

Sets the label color for an object label.

Parameters
indexLabel index (0 to EDataset::GetNumLabels - 1).
colorNew color for the label

◆ SetObjectLabelOpacity()

void eVision::EasyDeepLearning::EDataset::SetObjectLabelOpacity ( int index,
const uint8_t opacity )

Sets the label opacity for an object label.

Parameters
indexLabel index (0 to EDataset::GetNumLabels - 1).
opacityNew opacity for the label

◆ SetObjectLabelWeight() [1/2]

void eVision::EasyDeepLearning::EDataset::SetObjectLabelWeight ( const std::string & label,
float weight )

Sets the weight of an object label.

Parameters
labelLabel
weightNew weight

◆ SetObjectLabelWeight() [2/2]

void eVision::EasyDeepLearning::EDataset::SetObjectLabelWeight ( int labelIndex,
float weight )

Sets the weight of an object label.

Parameters
labelIndexIndex of the object label
weightNew weight

◆ SetObjectSize()

void eVision::EasyDeepLearning::EDataset::SetObjectSize ( int objectSize)

Object size for EasyLocate Interest point.

Parameters
objectSizeNew object size

◆ SetOCRAnnotations()

void eVision::EasyDeepLearning::EDataset::SetOCRAnnotations ( int imgId,
const std::vector< eVision::EasyDeepOCR::ETextLine > & texts )

Sets the ground truth text lines for the specified image.

Parameters
imgIdIndex of the image.
textsText lines of the image.

◆ SetRegionOfInterest()

void eVision::EasyDeepLearning::EDataset::SetRegionOfInterest ( int imageIndex,
int xOrg,
int yOrg,
int width,
int height )

Sets the region of interest for the specified image.

Parameters
imageIndexIndex of the image.
xOrgROI origin abscissa
yOrgROI origin ordinate
widthROI width
heightROI height

Any objects or segmentation located outside of the region of interest will be lost.

◆ SetSegmentationLabel()

void eVision::EasyDeepLearning::EDataset::SetSegmentationLabel ( int index,
const std::string & label )

Sets the segmentation labels.

Parameters
indexIndex of the segmentation label
labelString representing the segmentation label

The segmentation label index 0 is reserved and corresponds to the "background" label. This segmentation label can't be changed.

◆ SetSegmentationLabelColor()

void eVision::EasyDeepLearning::EDataset::SetSegmentationLabelColor ( int index,
const eVision::ERGBColor & color )

Sets the label color for a segmentation label.

Parameters
indexLabel index (0 to EDataset::GetNumLabels - 1).
colorNew color for the label

◆ SetSegmentationLabelOpacity()

void eVision::EasyDeepLearning::EDataset::SetSegmentationLabelOpacity ( int index,
const uint8_t opacity )

Sets the label opacity for a segmentation label.

Parameters
indexLabel index (0 to EDataset::GetNumLabels - 1).
opacityNew opacity for the label

◆ SetSegmentationLabelWeight() [1/2]

void eVision::EasyDeepLearning::EDataset::SetSegmentationLabelWeight ( const std::string & label,
float weight )

Sets the segmentation label weight.

Parameters
labelSegmentation label
weightWeight of the segmentation label

◆ SetSegmentationLabelWeight() [2/2]

void eVision::EasyDeepLearning::EDataset::SetSegmentationLabelWeight ( int index,
float weight )

Sets the segmentation label weight.

Parameters
indexIndex of the segmentation label
weightWeight of the segmentation label

◆ SetSegmentationMap()

void eVision::EasyDeepLearning::EDataset::SetSegmentationMap ( int imageIndex,
const eVision::EROIBW16 & segmentationMap )

Sets the segmentation map of an image. The segmentation map is a 16-bit EROIBW16 image where the value of each pixel is equal to the corresponding segmentation label index (see EDataset::GetSegmentationLabel).

If an image has no segmentation (EDataset::HasSegmentation), the getter will throw an exception.

Parameters
imageIndexImage index
segmentationMapSegmentation map

◆ SplitDataset() [1/3]

void eVision::EasyDeepLearning::EDataset::SplitDataset ( eVision::EasyDeepLearning::EDataset & d1,
eVision::EasyDeepLearning::EDataset & d2 ) const

Splits the dataset in two parts to be used for training and validation respectively.

Parameters
d1First part of the dataset
d2Second part of the dataset

◆ SplitDataset() [2/3]

void eVision::EasyDeepLearning::EDataset::SplitDataset ( eVision::EasyDeepLearning::EDataset & d1,
eVision::EasyDeepLearning::EDataset & d2,
float proportion ) const

Splits the dataset in two parts to be used for training and validation respectively.

Parameters
d1First part of the dataset
d2Second part of the dataset
proportionProportion of image of each class to put into the first part. The remaining images are put in d2

◆ SplitDataset() [3/3]

void eVision::EasyDeepLearning::EDataset::SplitDataset ( eVision::EasyDeepLearning::EDataset & d1,
eVision::EasyDeepLearning::EDataset & d2,
float proportion,
bool random ) const

Splits the dataset in two parts to be used for training and validation respectively.

Parameters
d1First part of the dataset
d2Second part of the dataset
proportionProportion of image of each class to put into the first part. The remaining images are put in d2
randomRandomly sample the images.

◆ SplitDatasetForLocator() [1/3]

void eVision::EasyDeepLearning::EDataset::SplitDatasetForLocator ( eVision::EasyDeepLearning::EDataset & d1,
eVision::EasyDeepLearning::EDataset & d2 ) const

Splits the dataset in two parts for training and validation of a ELocator tool. Images without object labeling are excluded from the split.

Parameters
d1First part of the dataset
d2Second part of the dataset

The method ensures that all the object labels are represented in d1. Thus, even when the parameter random is set to false, the images in d1 and d2 can be ordered differently than they were in the original dataset.

◆ SplitDatasetForLocator() [2/3]

void eVision::EasyDeepLearning::EDataset::SplitDatasetForLocator ( eVision::EasyDeepLearning::EDataset & d1,
eVision::EasyDeepLearning::EDataset & d2,
float proportion ) const

Splits the dataset in two parts for training and validation of a ELocator tool. Images without object labeling are excluded from the split.

Parameters
d1First part of the dataset
d2Second part of the dataset
proportionProportion of image of each class to put into the first part. The remaining images are put in d2

The method ensures that all the object labels are represented in d1. Thus, even when the parameter random is set to false, the images in d1 and d2 can be ordered differently than they were in the original dataset.

◆ SplitDatasetForLocator() [3/3]

void eVision::EasyDeepLearning::EDataset::SplitDatasetForLocator ( eVision::EasyDeepLearning::EDataset & d1,
eVision::EasyDeepLearning::EDataset & d2,
float proportion,
bool random ) const

Splits the dataset in two parts for training and validation of a ELocator tool. Images without object labeling are excluded from the split.

Parameters
d1First part of the dataset
d2Second part of the dataset
proportionProportion of image of each class to put into the first part. The remaining images are put in d2
randomRandomly sample the images.

The method ensures that all the object labels are represented in d1. Thus, even when the parameter random is set to false, the images in d1 and d2 can be ordered differently than they were in the original dataset.

◆ SplitDatasetForSegmentation() [1/3]

void eVision::EasyDeepLearning::EDataset::SplitDatasetForSegmentation ( eVision::EasyDeepLearning::EDataset & d1,
eVision::EasyDeepLearning::EDataset & d2 ) const

Splits the dataset in two parts for a supervised segmenter. The two parts are to be used for training and validation respectively.

Parameters
d1First part of the dataset
d2Second part of the dataset

The method ensures that all the segmentation labels are represented in d1. Thus, even when the parameter random is set to false, the images in d1 and d2 can be ordered differently than they were in the original dataset.

◆ SplitDatasetForSegmentation() [2/3]

void eVision::EasyDeepLearning::EDataset::SplitDatasetForSegmentation ( eVision::EasyDeepLearning::EDataset & d1,
eVision::EasyDeepLearning::EDataset & d2,
float proportion ) const

Splits the dataset in two parts for a supervised segmenter. The two parts are to be used for training and validation respectively.

Parameters
d1First part of the dataset
d2Second part of the dataset
proportionProportion of image of each class to put into the first part. The remaining images are put in d2

The method ensures that all the segmentation labels are represented in d1. Thus, even when the parameter random is set to false, the images in d1 and d2 can be ordered differently than they were in the original dataset.

◆ SplitDatasetForSegmentation() [3/3]

void eVision::EasyDeepLearning::EDataset::SplitDatasetForSegmentation ( eVision::EasyDeepLearning::EDataset & d1,
eVision::EasyDeepLearning::EDataset & d2,
float proportion,
bool random ) const

Splits the dataset in two parts for a supervised segmenter. The two parts are to be used for training and validation respectively.

Parameters
d1First part of the dataset
d2Second part of the dataset
proportionProportion of image of each class to put into the first part. The remaining images are put in d2
randomRandomly sample the images.

The method ensures that all the segmentation labels are represented in d1. Thus, even when the parameter random is set to false, the images in d1 and d2 can be ordered differently than they were in the original dataset.

◆ UnsetImageLabel()

void eVision::EasyDeepLearning::EDataset::UnsetImageLabel ( int index)

Unset the label of the given image of the dataset. After this operation, the given image will have no classification labels.

Parameters
indexIndex of the image for which to unset the label

◆ UnsetImageObjectLabeling()

void eVision::EasyDeepLearning::EDataset::UnsetImageObjectLabeling ( int imageIndex)

Unsets the object labeling for the specified image. This sets the image as not having been labeled for object detection. This image won't be use for training with a ELocator tool.

Parameters
imageIndexIndex of the image

◆ UnsetOCRAnnotations()

void eVision::EasyDeepLearning::EDataset::UnsetOCRAnnotations ( int imgId)

Unsets the OCR labeling for the specified image.

Parameters
imgIdIndex of the image.

◆ UnsetSegmentation()

void eVision::EasyDeepLearning::EDataset::UnsetSegmentation ( int imageIndex)

Unsets the segmentation of an image. After this operation, the image will have no segmentation.

Parameters
imageIndexImage index

Member Data Documentation

◆ wrappedClass_

CppWrapperInternal::WrappedClass eVision::EasyDeepLearning::EDataset::wrappedClass_