functions getDefaultClassifierNM1() and getDefaultClassifierNM2() allow to implicitly load the default classifiers when creating a ERFilter object

This commit is contained in:
lluis 2013-09-13 12:54:23 +02:00
parent c511d5d649
commit 95d92c099c
2 changed files with 44 additions and 0 deletions

View File

@ -164,6 +164,7 @@ public:
\param cb Callback with the classifier. \param cb Callback with the classifier.
if omitted tries to load a default classifier from file trained_classifierNM1.xml if omitted tries to load a default classifier from file trained_classifierNM1.xml
default classifier can be implicitly load with function getDefaultClassifierNM1()
\param thresholdDelta Threshold step in subsequent thresholds when extracting the component tree \param thresholdDelta Threshold step in subsequent thresholds when extracting the component tree
\param minArea The minimum area (% of image size) allowed for retreived ER's \param minArea The minimum area (% of image size) allowed for retreived ER's
\param minArea The maximum area (% of image size) allowed for retreived ER's \param minArea The maximum area (% of image size) allowed for retreived ER's
@ -188,12 +189,32 @@ CV_EXPORTS Ptr<ERFilter> createERFilterNM1(const Ptr<ERFilter::Callback>& cb = P
\param cb Callback with the classifier \param cb Callback with the classifier
if omitted tries to load a default classifier from file trained_classifierNM2.xml if omitted tries to load a default classifier from file trained_classifierNM2.xml
default classifier can be implicitly load with function getDefaultClassifierNM2()
\param minProbability The minimum probability P(er|character) allowed for retreived ER's \param minProbability The minimum probability P(er|character) allowed for retreived ER's
*/ */
CV_EXPORTS Ptr<ERFilter> createERFilterNM2(const Ptr<ERFilter::Callback>& cb = Ptr<ERFilter::Callback>(), CV_EXPORTS Ptr<ERFilter> createERFilterNM2(const Ptr<ERFilter::Callback>& cb = Ptr<ERFilter::Callback>(),
float minProbability = 0.3); float minProbability = 0.3);
/*!
Allow to implicitly load the default classifier when creating an ERFilter object.
The function takes no parameters and returns a pointer to ERFilter::Callback.
The dafault classifier is loaded from file trained_classifierNM1.xml
if it's found in current directory.
*/
CV_EXPORTS Ptr<ERFilter::Callback> getDefaultClassifierNM1();
/*!
Allow to implicitly load the default classifier when creating an ERFilter object.
The function takes no parameters and returns a pointer to ERFilter::Callback.
The dafault classifier is loaded from file trained_classifierNM2.xml
if it's found in current directory.
*/
CV_EXPORTS Ptr<ERFilter::Callback> getDefaultClassifierNM2();
// computeNMChannels operation modes // computeNMChannels operation modes
enum { ERFILTER_NM_RGBLGrad = 0, enum { ERFILTER_NM_RGBLGrad = 0,
ERFILTER_NM_IHSGrad = 1 ERFILTER_NM_IHSGrad = 1

View File

@ -1142,6 +1142,29 @@ Ptr<ERFilter> createERFilterNM2(const Ptr<ERFilter::Callback>& cb, float minProb
return (Ptr<ERFilter>)filter; return (Ptr<ERFilter>)filter;
} }
/*!
Allow to implicitly load the default classifier when creating an ERFilter object.
The function takes no parameters and returns a pointer to ERFilter::Callback.
The dafault classifier is loaded from file trained_classifierNM1.xml
if it's found in current directory.
*/
Ptr<ERFilter::Callback> getDefaultClassifierNM1()
{
return makePtr<ERClassifierNM1>();
}
/*!
Allow to implicitly load the default classifier when creating an ERFilter object.
The function takes no parameters and returns a pointer to ERFilter::Callback.
The dafault classifier is loaded from file trained_classifierNM2.xml
if it's found in current directory.
*/
Ptr<ERFilter::Callback> getDefaultClassifierNM2()
{
return makePtr<ERClassifierNM2>();
}
/* ------------------------------------------------------------------------------------*/ /* ------------------------------------------------------------------------------------*/
/* -------------------------------- Compute Channels NM -------------------------------*/ /* -------------------------------- Compute Channels NM -------------------------------*/