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

A sample is composed of an image, and optionally a region, together with one or several texts, which are visible in the image. These texts indicate what outputs are expected when calling ETextReader::Read on this image. A ESample is only meant to be contained in ESampleList. More...

#include <eVision/EasyOcr/EasyDeepOCR/ESample.h>

Collaboration diagram for eVision::EasyDeepOCR::ESample:

Public Member Functions

 ESample ()
 Creates a ESample.
 ESample (const eVision::EasyDeepOCR::ESample &other)
 Creates a ESample.
 ESample (const std::string &path)
 Creates a ESample.
 ESample (const std::string &path, const std::vector< eVision::EasyDeepOCR::EText > &texts)
 Creates a ESample.
 ESample (const std::string &path, const eVision::ERegion &region)
 Creates a ESample.
 ESample (const std::string &path, const eVision::ERegion &region, const std::vector< eVision::EasyDeepOCR::EText > &texts)
 Creates a ESample.
virtual ~ESample () throw ()
eVision::EasyDeepOCR::ESample & operator= (const eVision::EasyDeepOCR::ESample &other)
 Assignment operator.
bool operator== (const eVision::EasyDeepOCR::ESample &other) const
 Checks if this ESample instance is strictly equal to another ESample instance.
bool operator!= (const eVision::EasyDeepOCR::ESample &other) const
 Checks if this ESample instance is not equal to another ESample instance.
bool IsEqual (const eVision::EasyDeepOCR::ESample &other) const
 Checks if this ESample instance is strictly equal to another ESample instance.
void Load (const std::string &path)
 Loads the ESample.
void Load (eVision::ESerializer *serializer)
 Loads the ESample.
void Save (const std::string &path)
 Saves the ESample.
void Save (eVision::ESerializer *serializer)
 Saves the ESample.
const eVision::EBaseROI & GetImage (eVision::EImageType imageType) const
 Returns the image of the sample.
const eVision::EBaseROI & GetImage () const
 Returns the image of the sample.
const eVision::EBaseROI & GetROI (eVision::EImageType imageType) const
 Returns the ROI enclosing the region of the sample. If no region is defined, the full image is returned.
const eVision::EBaseROI & GetROI () const
 Returns the ROI enclosing the region of the sample. If no region is defined, the full image is returned.
eVision::EImageType GetAutomaticImageType () const
 Returns the image type of ESample::GetImage when called without arguments.
void SetImagePath (const std::string &path)
 Path to the image of the sample.
std::string GetImagePath () const
 Path to the image of the sample.
void ReplaceBasePath (const std::string &oldBasePath, const std::string &newBasePath)
 Replaces the old base path with a new base path in the image path. Throws if the old base path is not contained in the image path.
std::vector< eVision::EasyDeepOCR::EText > GetTexts () const
 List of texts.
void SetTexts (const std::vector< eVision::EasyDeepOCR::EText > &texts)
 List of texts.
void SetRegion (const eVision::ERegion &region)
 Region of the sample.
eVision::ERegion GetRegion () const
 Region of the sample.
bool GetHasRegion () const
 Returns whether there is a region attached to this sample.
 ESample (CppWrapperInternal::InternalConstructor)

Public Attributes

CppWrapperInternal::WrappedClass wrappedClass_

Detailed Description

A sample is composed of an image, and optionally a region, together with one or several texts, which are visible in the image. These texts indicate what outputs are expected when calling ETextReader::Read on this image. A ESample is only meant to be contained in ESampleList.

License(s): EasyDeepOCR

Constructor & Destructor Documentation

◆ ESample() [1/7]

eVision::EasyDeepOCR::ESample::ESample ( )

Creates a ESample.

◆ ESample() [2/7]

eVision::EasyDeepOCR::ESample::ESample ( const eVision::EasyDeepOCR::ESample & other)

Creates a ESample.

Parameters
otherAnother ESample to be copied in the new ESample.

◆ ESample() [3/7]

eVision::EasyDeepOCR::ESample::ESample ( const std::string & path)

Creates a ESample.

Parameters
pathPath to the image.

◆ ESample() [4/7]

eVision::EasyDeepOCR::ESample::ESample ( const std::string & path,
const std::vector< eVision::EasyDeepOCR::EText > & texts )

Creates a ESample.

Parameters
pathPath to the image.
textsTexts of interest.

◆ ESample() [5/7]

eVision::EasyDeepOCR::ESample::ESample ( const std::string & path,
const eVision::ERegion & region )

Creates a ESample.

Parameters
pathPath to the image.
regionRegion containing the texts of interest.

◆ ESample() [6/7]

eVision::EasyDeepOCR::ESample::ESample ( const std::string & path,
const eVision::ERegion & region,
const std::vector< eVision::EasyDeepOCR::EText > & texts )

Creates a ESample.

Parameters
pathPath to the image.
regionRegion containing the texts of interest.
textsTexts of interest.

◆ ~ESample()

eVision::EasyDeepOCR::ESample::~ESample ( )
throw ( )
virtual

◆ ESample() [7/7]

eVision::EasyDeepOCR::ESample::ESample ( CppWrapperInternal::InternalConstructor )

Member Function Documentation

◆ GetAutomaticImageType()

eVision::EImageType eVision::EasyDeepOCR::ESample::GetAutomaticImageType ( ) const

Returns the image type of ESample::GetImage when called without arguments.

◆ GetHasRegion()

bool eVision::EasyDeepOCR::ESample::GetHasRegion ( ) const

Returns whether there is a region attached to this sample.

◆ GetImage() [1/2]

const eVision::EBaseROI & eVision::EasyDeepOCR::ESample::GetImage ( ) const

Returns the image of the sample.

◆ GetImage() [2/2]

const eVision::EBaseROI & eVision::EasyDeepOCR::ESample::GetImage ( eVision::EImageType imageType) const

Returns the image of the sample.

Parameters
imageTypeSpecifies the image type for loading the sample image. If not provided, the image type will be automatically determined based on the sample image files.

◆ GetImagePath()

std::string eVision::EasyDeepOCR::ESample::GetImagePath ( ) const

Path to the image of the sample.

◆ GetRegion()

eVision::ERegion eVision::EasyDeepOCR::ESample::GetRegion ( ) const

Region of the sample.

◆ GetROI() [1/2]

const eVision::EBaseROI & eVision::EasyDeepOCR::ESample::GetROI ( ) const

Returns the ROI enclosing the region of the sample. If no region is defined, the full image is returned.

◆ GetROI() [2/2]

const eVision::EBaseROI & eVision::EasyDeepOCR::ESample::GetROI ( eVision::EImageType imageType) const

Returns the ROI enclosing the region of the sample. If no region is defined, the full image is returned.

Parameters
imageTypeSpecifies the image type for loading the sample image. If not provided, the image type will be automatically determined based on the sample image files.

◆ GetTexts()

std::vector< eVision::EasyDeepOCR::EText > eVision::EasyDeepOCR::ESample::GetTexts ( ) const

List of texts.

◆ IsEqual()

bool eVision::EasyDeepOCR::ESample::IsEqual ( const eVision::EasyDeepOCR::ESample & other) const

Checks if this ESample instance is strictly equal to another ESample instance.

Parameters
otherReference to the ESample instance to compare with

◆ Load() [1/2]

void eVision::EasyDeepOCR::ESample::Load ( const std::string & path)

Loads the ESample.

Parameters
pathPath where to save the ESample.

◆ Load() [2/2]

void eVision::EasyDeepOCR::ESample::Load ( eVision::ESerializer * serializer)

Loads the ESample.

Parameters
serializer

◆ operator!=()

bool eVision::EasyDeepOCR::ESample::operator!= ( const eVision::EasyDeepOCR::ESample & other) const

Checks if this ESample instance is not equal to another ESample instance.

Parameters
otherReference to the ESample instance to compare with

◆ operator=()

eVision::EasyDeepOCR::ESample & eVision::EasyDeepOCR::ESample::operator= ( const eVision::EasyDeepOCR::ESample & other)

Assignment operator.

Parameters
otherAnother ESample to be assigned in the new ESample.

◆ operator==()

bool eVision::EasyDeepOCR::ESample::operator== ( const eVision::EasyDeepOCR::ESample & other) const

Checks if this ESample instance is strictly equal to another ESample instance.

Parameters
otherReference to the ESample instance to compare with

This operator is stricly equivalent to the ESample::IsEqual method.

◆ ReplaceBasePath()

void eVision::EasyDeepOCR::ESample::ReplaceBasePath ( const std::string & oldBasePath,
const std::string & newBasePath )

Replaces the old base path with a new base path in the image path. Throws if the old base path is not contained in the image path.

Parameters
oldBasePathOld base path to be replaced.
newBasePathNew path to replace the old base path with.

◆ Save() [1/2]

void eVision::EasyDeepOCR::ESample::Save ( const std::string & path)

Saves the ESample.

Parameters
pathPath where to save the ESample.

◆ Save() [2/2]

void eVision::EasyDeepOCR::ESample::Save ( eVision::ESerializer * serializer)

Saves the ESample.

Parameters
serializer

◆ SetImagePath()

void eVision::EasyDeepOCR::ESample::SetImagePath ( const std::string & path)

Path to the image of the sample.

◆ SetRegion()

void eVision::EasyDeepOCR::ESample::SetRegion ( const eVision::ERegion & region)

Region of the sample.

◆ SetTexts()

void eVision::EasyDeepOCR::ESample::SetTexts ( const std::vector< eVision::EasyDeepOCR::EText > & texts)

List of texts.

Member Data Documentation

◆ wrappedClass_

CppWrapperInternal::WrappedClass eVision::EasyDeepOCR::ESample::wrappedClass_