3#include "../_cexports/c_minos.h"
5#include "../global.hpp"
7#include "../matrix_2d.hpp"
8#include "../point_2d.hpp"
10#include "../area_2d.hpp"
12#include "search_result.hpp"
23namespace Minos {
class TrainingSet; }
26inline HandleGuard<Minos::TrainingSet>::HandleGuard(
void * handle) noexcept
27 : HandleGuard<Minos::TrainingSet>(handle, [](
void* h) { CVB_CALL_CAPI(ReleaseObject(h)); })
49 InstanceInfo (
const SharedHandleGuard<TrainingSet> &sguardTrSet, CExports::MTSINSTANCE nativeHandle)
50 : sguardTrSet_(sguardTrSet), nativeHandle_ (nativeHandle)
64 return static_cast<int> (CVB_CALL_CAPI (InstanceIndex(
Handle())));
75 return Internal::DoHandleCallObjectOut<class Image>(CVB_CALL_CAPI(CreateImageFromInstance(
Handle())));
85 double GetCorrelation ()
const
106 double dX = CVB_CALL_CAPI (InstanceX(
Handle()));
107 double dY = CVB_CALL_CAPI (InstanceY(
Handle()));
128 return nativeHandle_;
132 SharedHandleGuard<TrainingSet> sguardTrSet_;
133 CExports::MTSINSTANCE nativeHandle_;
146 return (lhs.Handle() == rhs.Handle());
159 return (!(lhs == rhs));
165 auto ReadInfos (
const T &collection) ->
std::vector<
decltype(collection.ReadInfo(0))>
167 auto count = collection.Count ();
168 std::vector<
decltype(collection.ReadInfo (0))> info;
169 for (
decltype(count) i = 0; i < count; ++i)
171 info.push_back (collection.ReadInfo (i));
177 template<
class Tcol,
class Tobj>
int IndexOf (
const Tcol &collection,
const Tobj &obj)
179 auto count = collection.Count ();
180 for (
decltype(count) i = 0; i <
count; ++i)
182 if (collection.ReadInfo (i) == obj)
226 auto instHandle = GetInstanceNativeHandle (index);
227 if (instHandle ==
nullptr)
229 Utilities::SystemInfo::ThrowLastError ();
242 return Private::ReadInfos (*
this);
255 return Private::IndexOf (*
this, obj);
271 auto count =
Count ();
272 for (
decltype(count) i = 0; i < count; ++i)
276 CVB_CALL_CAPI_CHECKED (RemoveMTSInstance(instance.
Handle()));
300 virtual int GetCount ()
const = 0;
301 virtual CExports::MTSINSTANCE GetInstanceNativeHandle (
int index)
const = 0;
304 SharedHandleGuard<TrainingSet> shandle_;
315 collectionParent_(sguard.Handle())
324 int GetCount ()
const override
326 return static_cast<int> (CVB_CALL_CAPI (NumMTSInstances(collectionParent_)));
329 CExports::MTSINSTANCE GetInstanceNativeHandle (
int index)
const override
331 return CVB_CALL_CAPI (MTSInstance (collectionParent_, index));
335 CExports::MTSINSTANCE collectionParent_;
346 collectionParent_(collectionParent)
367 double dX = location.
X();
368 double dY = location.
Y();
369 CExports::MTSINSTANCE instance;
370 CVB_CALL_CAPI_CHECKED (NewMTSInstanceTyped(collectionParent_, name.c_str(), askForce, dX, dY, instance));
371 if (instance ==
nullptr)
379 int GetCount ()
const override
381 return static_cast<int> (CVB_CALL_CAPI (NumMTSImageInstances(collectionParent_)));
384 CExports::MTSINSTANCE GetInstanceNativeHandle (
int index)
const override
386 return CVB_CALL_CAPI (MTSImageInstance (collectionParent_, index));
390 CExports::MTSIMAGE collectionParent_;
401 collectionParent_(collectionParent)
410 int GetCount ()
const override
412 return static_cast<int> (CVB_CALL_CAPI (NumMTSModelInstances(collectionParent_)));
415 CExports::MTSINSTANCE GetInstanceNativeHandle (
int index)
const override
417 return CVB_CALL_CAPI (MTSModelInstance (collectionParent_, index));
421 CExports::MTSMODEL collectionParent_;
434 ImageInfo (
const SharedHandleGuard<TrainingSet> &sguardTrSet,
int index)
435 : sguardTrSet_(sguardTrSet),
436 nativeHandle_ (CVB_CALL_CAPI (MTSImage(sguardTrSet.Handle(), index))),
437 instances_ (sguardTrSet_, nativeHandle_)
439 if (nativeHandle_ ==
nullptr)
441 Utilities::SystemInfo::ThrowLastError();
456 return static_cast<int> (CVB_CALL_CAPI (MTSImageIndex(
Handle())));
467 return Internal::DoBoolCallObjectOut<class Image>([&](
void* & resimg)
469 resimg = CVB_CALL_CAPI(GetImageFromImage(
Handle()));
470 return CVB_CALL_CAPI(ShareObject (resimg));
484 CVB_CALL_CAPI_CHECKED(TransformMTSImage(
Handle(),
reinterpret_cast<const CExports::TMatrix&
>(matrix)));
497 CExports::RESULTS hSearchResults;
498 CVB_CALL_CAPI_CHECKED (MTSImageCheck (
Handle(), threshold,
static_cast<int>(density * 1000.0),
nullptr,
nullptr, hSearchResults));
499 ReleaseObjectGuard hSearchResHolder (hSearchResults);
500 return Private::SearchResultsToArray(hSearchResults);
525 return nativeHandle_;
529 SharedHandleGuard<TrainingSet> sguardTrSet_;
530 CExports::MTSIMAGE nativeHandle_;
544 return (lhs.Handle() == rhs.Handle());
557 return (!(lhs == rhs));
562 auto imageIndex = CVB_CALL_CAPI(GetImageFromInstance(
Handle()));
563 return ImageInfo(sguardTrSet_, CVB_CALL_CAPI(MTSImageIndex(imageIndex)));
587 return static_cast<int> (CVB_CALL_CAPI (NumMTSImages(shandle_.Handle())));
610 return Private::ReadInfos (*
this);
623 return Private::IndexOf (*
this, obj);
637 auto h = CVB_CALL_CAPI (NewMTSImageIndex(shandle_.Handle(), plane.Parent().Handle(), plane.Plane()));
640 Utilities::SystemInfo::ThrowLastError ();
657 auto count =
Count ();
658 for (
decltype(count) i = 0; i < count; ++i)
662 CVB_CALL_CAPI_CHECKED (RemoveMTSImage(image.Handle()));
686 SharedHandleGuard<TrainingSet> shandle_;
699 ModelInfo (
const SharedHandleGuard<TrainingSet> &sguardTrSet,
int index)
700 : sguardTrSet_(sguardTrSet),
701 nativeHandle_ (CVB_CALL_CAPI (MTSModel(sguardTrSet.Handle(), index))),
702 instances_ (sguardTrSet_, nativeHandle_)
704 if (nativeHandle_ ==
nullptr)
706 Utilities::SystemInfo::ThrowLastError ();
721 return static_cast<int> (CVB_CALL_CAPI (MTSModelIndex(
Handle())));
732 return Internal::DoBoolCallObjectOut<class Image>([&](
void* & resimg)
734 resimg = CVB_CALL_CAPI(GetImageFromModel(
Handle()));
735 return CVB_CALL_CAPI(ShareObject (resimg));
746 const Char *name =
nullptr;
747 CVB_CALL_CAPI (GetModelNameTyped(
Handle(), name));
763 CVB_CALL_CAPI_CHECKED (SetModelNameTyped(
Handle(), name.c_str()));
774 CVB_CALL_CAPI_CHECKED (GetModelAdvance (
Handle(), advX, advY));
785 CVB_CALL_CAPI_CHECKED (SetModelAdvance (
Handle(), advanceVector.
X(), advanceVector.
Y()));
796 Area2D featureWindowNative;
797 CVB_CALL_CAPI_CHECKED (GetFeatureWindow (
Handle(),
reinterpret_cast<CExports::TArea&
>(featureWindowNative)));
798 return Round (
Rect<double> (featureWindowNative.
P0().
X(), featureWindowNative.
P0().
Y(), featureWindowNative.
P1().
X(), featureWindowNative.
P2().
Y()));
810 CVB_CALL_CAPI_CHECKED (
SetFeatureWindow (
Handle(),
reinterpret_cast<CExports::TArea&
>(featureWindowNative)));
820 return Image()->CoordinateSystem().Translation();
830 auto cs =
Image()->CoordinateSystem();
831 cs.Translation() = origin;
832 Image()->CoordinateSystem() = cs;
833 CVB_CALL_CAPI_CHECKED (TranslateModelOrigin(
Handle()));
860 CExports::RESULTS hSearchResults;
861 CVB_CALL_CAPI_CHECKED (MTSModelImageCheck (
Handle(), trainingSetImage.
Handle(), threshold,
static_cast<int>(density * 1000.0),
nullptr,
nullptr, hSearchResults));
862 ReleaseObjectGuard hSearchResHolder (hSearchResults);
863 return Private::SearchResultsToArray(hSearchResults);
876 CExports::RESULTS hSearchResults;
877 CVB_CALL_CAPI_CHECKED (MTSModelCheck (
Handle(), threshold,
static_cast<int>(density * 1000.0),
nullptr,
nullptr, hSearchResults));
878 ReleaseObjectGuard hSearchResHolder (hSearchResults);
879 return Private::SearchResultsToArray(hSearchResults);
894 int left = INT_MAX, top = INT_MAX, right = INT_MAX, bottom = INT_MAX;
898 auto loc_x = std::lround(i.Location ().X ());
903 auto loc_y = std::lround(i.Location ().Y ());
908 auto srcimg_w = i.SourceImage ().Image ()->Width ();
909 if (srcimg_w - loc_x < right)
911 right = srcimg_w - loc_x - 1;
913 auto srcimg_h = i.SourceImage ().Image ()->Height ();
914 if (srcimg_h - loc_y < bottom)
916 bottom = srcimg_h - loc_y - 1;
922 return Rect<int>(left, top, right, bottom);
937 return Rect<int>(left, top, right, bottom);
949 return nativeHandle_;
953 SharedHandleGuard<TrainingSet> sguardTrSet_;
954 CExports::MTSMODEL nativeHandle_;
968 return (lhs.Handle() == rhs.Handle());
981 return (!(lhs == rhs));
986 auto modelIndex = CVB_CALL_CAPI(GetModelFromInstance(nativeHandle_));
987 return ModelInfo(sguardTrSet_, CVB_CALL_CAPI(MTSModelIndex(modelIndex)));
1011 return static_cast<int> (CVB_CALL_CAPI (NumMTSModels(shandle_.Handle())));
1034 return Private::ReadInfos (*
this);
1047 return Private::IndexOf (*
this, obj);
1059 auto count =
Count ();
1060 for (
decltype(count) i = 0; i < count; ++i)
1083 auto instance = CVB_CALL_CAPI (NewMTSModelTyped(image.Handle(), name.c_str(), location.
X(), location.
Y(),
reinterpret_cast<CExports::TArea&
>(featureWindowNative)));
1084 if (instance ==
nullptr)
1086 Utilities::SystemInfo::ThrowLastError ();
1103 auto count =
Count ();
1104 for (
decltype(count) i = 0; i < count; ++i)
1108 CVB_CALL_CAPI_CHECKED (RemoveMTSModel(model.
Handle()));
1139 CVB_CALL_CAPI_CHECKED(SetMTSGlobalAdvance(shandle_.Handle(),
true, vec.
X(), vec.
Y()));
1143 SharedHandleGuard<TrainingSet> shandle_;
1155 : shandle_(std::move(guard)),
1156 fileName_ (srcFileName),
1157 instances_ (shandle_), images_ (shandle_), models_ (shandle_)
1162 static CExports::MTS CreateInternal ()
1164 CExports::MTS mts = CVB_CALL_CAPI (CreateMTS(3, 0.6));
1167 Utilities::SystemInfo::ThrowLastError();
1173 static CExports::MTS LoadInternal (
const String & fileName)
1175 CExports::MTS mts =
nullptr;
1177 CVB_CALL_CAPI_CHECKED (LoadMTSFileTyped (fileName.c_str(), mts));
1228 return Internal::DoBoolCallObjectOut<TrainingSet>([&](
void* & restset)
1231 return CVB_CALL_CAPI(MemoryToMTS (
const_cast<void*
>(buffer),
static_cast<long>(size), restset));
1241 template <
class RANGE>
1244 auto bufferRange = MakeRangeAdapter<std::uint8_t> (buffer);
1245 return FromBuffer (bufferRange.Data (), bufferRange.Size ());
1257 return shandle_.Handle();
1270 if (!guard.Handle ())
1286 CVB_CALL_CAPI_CHECKED (WriteMTSFileTyped (
Handle(), fileName.c_str()));
1287 fileName_ = fileName;
1298 auto sizeNeeded = CVB_CALL_CAPI (GetMTSSize(
Handle()));
1300 CVB_CALL_CAPI_CHECKED (MTSToMemory (
Handle(), buffer.data(), sizeNeeded));
1313 return Internal::DoBoolCallObjectOut<TrainingSet>([&](
void* & resclas)
1316 return CVB_CALL_CAPI(MTSTransform (
Handle(),
reinterpret_cast<const CExports::TMatrix&
>(transformation), resclas));
1330 CExports::RESULTS hSearchResults;
1331 CVB_CALL_CAPI_CHECKED (MTSConsistencyCheck (
Handle (), threshold,
static_cast<int>(density * 1000.0),
nullptr,
nullptr, hSearchResults));
1332 ReleaseObjectGuard hSearchResHolder (hSearchResults);
1333 return Private::SearchResultsToArray(hSearchResults);
1346 return static_cast<int> (CVB_CALL_CAPI (NumMTSClasses(
Handle())));
1369 return instances_.
Count();
1417 CExports::cvbbool_t retval;
1418 CVB_CALL_CAPI_CHECKED (GetMTSModified(
Handle(), retval));
1431 CVB_CALL_CAPI_CHECKED (SetMTSModified(
Handle(), isModified));
1441 CExports::cvbdim_t left, top, right, bottom;
1442 CVB_CALL_CAPI_CHECKED (GetMTSExtent (
Handle (), left, top, right, bottom));
1443 return Rect<int> (
static_cast<int>(left),
static_cast<int>(top),
static_cast<int>(right),
static_cast<int>(bottom));
1455 CVB_CALL_CAPI_CHECKED (GetMTSLastFeatureWnd(
Handle(),
reinterpret_cast<CExports::TArea&
>(area)));
1466 const Char *comment =
nullptr;
1467 CVB_CALL_CAPI (MTSCommentTyped(
Handle(), comment));
1468 return (comment !=
nullptr) ?
String (comment) :
String ();
1478 CVB_CALL_CAPI_CHECKED (SetMTSCommentTyped (
Handle(), comment.c_str()));
1488 double expectationRadius, correlationThreshold;
1489 CVB_CALL_CAPI_CHECKED (GetMTSCorelParams(
Handle(), expectationRadius, correlationThreshold));
1490 return expectationRadius;
1510 double expectationRadius, correlationThreshold;
1511 CVB_CALL_CAPI_CHECKED (GetMTSCorelParams(
Handle(), expectationRadius, correlationThreshold));
1512 return correlationThreshold;
1526 SharedHandleGuard<TrainingSet> shandle_;
1527 mutable String fileName_;
Structure that represents an area of interest in the image.
Definition: area_2d.hpp:21
Point2D< double > P2() const noexcept
Gets P2 of the area (top right corner).
Definition: area_2d.hpp:117
Point2D< double > P0() const noexcept
Gets P0 of the area (top left corner).
Definition: area_2d.hpp:89
Point2D< double > P1() const noexcept
Gets P1 of the area (lower left corner).
Definition: area_2d.hpp:103
Image plane information container.
Definition: decl_image_plane.hpp:33
Double precision 2x2 matrix class.
Definition: matrix_2d.hpp:16
Class that maintains the collection of Training Images inside a Minos Training Set.
Definition: training_set.hpp:570
void Add(const ImagePlane &plane)
Add a new training set image to the parent training set.
Definition: training_set.hpp:635
ImageInfo ReadInfo(int index) const
Retrieves the indexed image information block.
Definition: training_set.hpp:597
std::vector< ImageInfo > ReadInfos() const
Retrieves all the items stored in the collection.
Definition: training_set.hpp:608
int Count() const
Retrieves the number of elements in the collection.
Definition: training_set.hpp:585
int IndexOf(const ImageInfo &obj) const
Determine the index of an image information object inside this collection.
Definition: training_set.hpp:621
bool Remove(const ImageInfo &image)
Remove a training set image along with its instances from the training set.
Definition: training_set.hpp:655
bool RemoveAt(int index)
Remove a training set image along with its instances from the training set.
Definition: training_set.hpp:680
Image that has been added to a training set.
Definition: training_set.hpp:428
std::vector< SearchResult > CheckConsistency(double threshold, double density=1.0)
Test this image for potentially forgotten instances to be trained.
Definition: training_set.hpp:495
ImageInstanceInfoCollection Instances() const
The instances belonging to this model.
Definition: training_set.hpp:511
void TransformImageAndInstances(Matrix2D matrix)
Transform this image and all instances trained from this image using a 2x2 matrix.
Definition: training_set.hpp:481
std::unique_ptr< class Image > Image() const
Image representation of this object.
Definition: training_set.hpp:465
int Index() const
Index of this object in the parent's collection.
Definition: training_set.hpp:454
void * Handle() const noexcept
Classic API MTSIMAGE handle.
Definition: training_set.hpp:523
Class that maintains the collection of Training Images inside a Minos Training Set.
Definition: training_set.hpp:342
InstanceInfo Add(const String &name, bool askForce, Point2D< double > location)
Extract a new instance from the parent image and added it to the model with the specified name.
Definition: training_set.hpp:365
Class that maintains the collection of Training Images inside a Minos object.
Definition: training_set.hpp:195
int Count() const
Retrieves the number of elements in the collection.
Definition: training_set.hpp:212
std::vector< InstanceInfo > ReadInfos() const
Retrieves all the items stored in the collection.
Definition: training_set.hpp:240
InstanceInfo ReadInfo(int index) const
Retrieves the indexed instance information block.
Definition: training_set.hpp:224
bool Remove(const InstanceInfo &instance)
Remove an instance from the training set.
Definition: training_set.hpp:269
int IndexOf(const InstanceInfo &obj) const
Determine the index of an image information object inside this collection.
Definition: training_set.hpp:253
bool RemoveAt(int index)
Remove an instance from the training set.
Definition: training_set.hpp:294
Class that maintains the collection of Training Images inside a Minos Training Set.
Definition: training_set.hpp:311
Instance information that has been added to a training set.
Definition: training_set.hpp:43
ImageInfo SourceImage() const
Retrieve the correlation between this instance image and the model image.
Definition: training_set.hpp:560
std::unique_ptr< class Image > Image() const
Image representation of this object.
Definition: training_set.hpp:73
int Index() const
Index of this object in the parent's collection.
Definition: training_set.hpp:62
Point2D< double > Location() const
Position in the SourceImage from which this instance has been extracted.
Definition: training_set.hpp:104
ModelInfo Model() const
The Training Set Model into which this instance has been trained.
Definition: training_set.hpp:984
void * Handle() const noexcept
Classic API MTSINSTANCE handle.
Definition: training_set.hpp:126
Class that maintains the collection of Training Images inside a Minos Training Set.
Definition: training_set.hpp:994
std::vector< ModelInfo > ReadInfos() const
Retrieves all the items stored in the collection.
Definition: training_set.hpp:1032
bool Remove(const ModelInfo &model)
Remove a model (and all the instances extracted for that model!) from the training set.
Definition: training_set.hpp:1101
int Count() const
Retrieves the number of elements in the collection.
Definition: training_set.hpp:1009
bool Contains(const String &name)
Check if the collection contains a model with the specified name.
Definition: training_set.hpp:1057
int IndexOf(const ModelInfo &obj) const
Determine the index of an image information object inside this collection.
Definition: training_set.hpp:1045
void SetGlobalAdvanceVector(Point2D< double > vec)
Set an advance vector for all available models.
Definition: training_set.hpp:1137
void Add(const ImageInfo &image, const String &name, Point2D< double > location, Rect< int > featureWindow)
Add a new model (plus the first instance of that model) to the training set.
Definition: training_set.hpp:1079
ModelInfo ReadInfo(int index) const
Retrieves the indexed model information block.
Definition: training_set.hpp:1021
bool RemoveAt(int index)
Remove a model (and all the instances extracted for that model!) from the training set.
Definition: training_set.hpp:1126
Model that has been added to a training set.
Definition: training_set.hpp:693
std::vector< SearchResult > CheckConsistency(double threshold, double density=1.0)
Test all images in the parent training set for instances of this model that might have been forgotten...
Definition: training_set.hpp:874
Rect< int > GetExtractableArea(const ImageInfo &image) const
Determine the maximum area from which an instance of this model may be extracted from a given trainin...
Definition: training_set.hpp:931
Point2D< double > AdvanceVector() const
Get the advance vector associated with this model.
Definition: training_set.hpp:771
Point2D< double > Origin() const
Get the origin of the model in terms of coordinates inside the feature window.
Definition: training_set.hpp:818
std::vector< SearchResult > CheckConsistency(const ImageInfo &trainingSetImage, double threshold, double density=1.0)
Test the image referenced by trainingSetImage for instances of this model that might have been forgot...
Definition: training_set.hpp:858
void SetAdvanceVector(Point2D< double > advanceVector)
Set the advance vector associated with this model.
Definition: training_set.hpp:783
std::unique_ptr< class Image > Image() const
Image representation of this object.
Definition: training_set.hpp:730
String Name() const
Get the name of the model.
Definition: training_set.hpp:744
void SetFeatureWindow(Rect< int > featureWindow)
Set the feature window for this model.
Definition: training_set.hpp:806
int Index() const
Index of this object in the parent's collection.
Definition: training_set.hpp:719
void SetOrigin(Point2D< double > origin)
Set the origin of the model in terms of coordinates inside the feature window.
Definition: training_set.hpp:828
Rect< int > GetMaxFeatureWindow() const
Retrieve the maximum values that may be set as feature window for this model.
Definition: training_set.hpp:892
ModelInstanceInfoCollection Instances() const
The instances belonging to this model.
Definition: training_set.hpp:844
void SetName(const String &name)
Set the name of the model.
Definition: training_set.hpp:761
Rect< int > FeatureWindow() const
Get the feature window for this model.
Definition: training_set.hpp:793
void * Handle() const noexcept
Classic API MTSMODEL handle.
Definition: training_set.hpp:947
Class that maintains the collection of Training Images inside a Minos Training Set.
Definition: training_set.hpp:397
A Minos Training Set from which a classifier can be generated.
Definition: training_set.hpp:1151
static TypedRange< std::unique_ptr< TrainingSet >, std::uint8_t, RANGE >::type FromBuffer(const RANGE &buffer)
Recreate a serialized Minos training set from a byte array.
Definition: training_set.hpp:1242
std::unique_ptr< TrainingSet > Transform(Matrix2D transformation)
Generate a new training set by transforming this training set with a 2x2 transformation matrix.
Definition: training_set.hpp:1311
ImageInfoCollection Images() const
The images contained in this training set.
Definition: training_set.hpp:1380
std::vector< SearchResult > CheckConsistency(double threshold, double density=1.0)
Test all images in the parent training set for instances of this model that might have been forgotten...
Definition: training_set.hpp:1328
double CorrelationThreshold() const
Gets the correlation threshold. The correlation value under which Minos proposes generating a new mod...
Definition: training_set.hpp:1508
int ClassCount() const
The number of identifiable classes inside this training set.
Definition: training_set.hpp:1344
static std::unique_ptr< TrainingSet > FromBuffer(const void *buffer, size_t size)
Recreate a serialized Minos training set from a byte array.
Definition: training_set.hpp:1226
void SetIsModified(bool isModified)
Set a flag that informs about unsaved modifications to the training set.
Definition: training_set.hpp:1429
TrainingSet(const String &fileName)
Load a saved training set from a file.
Definition: training_set.hpp:1196
static std::unique_ptr< TrainingSet > FromHandle(HandleGuard< TrainingSet > &&guard)
Creates training set from a classic API handle.
Definition: training_set.hpp:1268
TrainingSet()
Create an empty training set.
Definition: training_set.hpp:1186
String Comment() const
Get the comment assigned to the training set at generation time.
Definition: training_set.hpp:1464
ModelInfoCollection Models() const
The models contained in this training set.
Definition: training_set.hpp:1393
std::vector< std::uint8_t > ToBuffer() const
Serializes the training set into a buffer.
Definition: training_set.hpp:1296
InstanceInfoCollection Instances() const
The instances contained in this training set.
Definition: training_set.hpp:1357
void SetExpectationRadius(double expectationRadius)
Set the expectation radius - the radius that is searched for the best occurrence of a sample,...
Definition: training_set.hpp:1498
void Save(const String &fileName) const
Write the training set to a file.
Definition: training_set.hpp:1284
Rect< int > Extent() const
Extent of the classes in the training set relative to the anchor point.
Definition: training_set.hpp:1439
bool IsModified() const
Get a flag that informs about unsaved modifications to the training set.
Definition: training_set.hpp:1415
void SetComment(String comment)
Set the comment assigned to the training set at generation time.
Definition: training_set.hpp:1476
int InstancesTotal() const
Total number of instances currently trained in this training set.
Definition: training_set.hpp:1367
static std::unique_ptr< TrainingSet > Load(const String &fileName)
Load a saved training set from a file.
Definition: training_set.hpp:1214
Rect< int > LastFeatureWindow() const
Feature window of the last model that has been created for the training set.
Definition: training_set.hpp:1451
void SetCorrelationThreshold(double correlationThreshold)
Set the correlation threshold - the correlation value below which Minos will suggest the generation o...
Definition: training_set.hpp:1520
TrainingSet(TrainingSet &&) noexcept=default
Move constructor.
String FileName() const
Name of the file, from which this training set was loaded (empty string if this image list was neithe...
Definition: training_set.hpp:1403
void * Handle() const noexcept
Classic API CLF handle.
Definition: training_set.hpp:1255
double ExpectationRadius() const
Get the expectation radius - the radius that is searched for the best occurrence of a sample,...
Definition: training_set.hpp:1486
T X() const noexcept
Gets the x-component of the point.
Definition: point_2d.hpp:86
T Y() const noexcept
Gets the y-component of the point.
Definition: point_2d.hpp:106
T Bottom() const noexcept
Gets bottom row of the rectangle (still inside the rectangle).
Definition: rect.hpp:151
T Top() const noexcept
Gets first row of the rectangle.
Definition: rect.hpp:111
T Right() const noexcept
Gets rightmost column of the rectangle (still inside the rectangle).
Definition: rect.hpp:131
T Left() const noexcept
Gets first column of the rectangle.
Definition: rect.hpp:91
bool operator==(const ClassifierModelInfo &lhs, const ClassifierModelInfo &rhs) noexcept
Comparison operator for ClassifierModelInfo objects.
Definition: classifier.hpp:159
bool operator!=(const ClassifierModelInfo &lhs, const ClassifierModelInfo &rhs) noexcept
Comparison operator for ClassifierModelInfo objects.
Definition: classifier.hpp:146
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24
char Char
Character type for wide characters or unicode characters.
Definition: string.hpp:59
Point2D< int > Round(const Point2D< T > &rhs) noexcept
Round to an integer point.
Definition: point_2d.hpp:380