Commit 95d92c09 authored by lluis's avatar lluis

functions getDefaultClassifierNM1() and getDefaultClassifierNM2() allow to…

functions getDefaultClassifierNM1() and getDefaultClassifierNM2() allow to implicitly load the default classifiers when creating a ERFilter object
parent c511d5d6
...@@ -164,6 +164,7 @@ public: ...@@ -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 ...@@ -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
......
...@@ -1142,6 +1142,29 @@ Ptr<ERFilter> createERFilterNM2(const Ptr<ERFilter::Callback>& cb, float minProb ...@@ -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 -------------------------------*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment