From 95d92c099c76e43e59bc6017c35231c62290bd31 Mon Sep 17 00:00:00 2001 From: lluis Date: Fri, 13 Sep 2013 12:54:23 +0200 Subject: [PATCH] functions getDefaultClassifierNM1() and getDefaultClassifierNM2() allow to implicitly load the default classifiers when creating a ERFilter object --- .../include/opencv2/objdetect/erfilter.hpp | 21 ++++++++++++++++++++ modules/objdetect/src/erfilter.cpp | 23 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/modules/objdetect/include/opencv2/objdetect/erfilter.hpp b/modules/objdetect/include/opencv2/objdetect/erfilter.hpp index 78b5847..0abb046 100644 --- a/modules/objdetect/include/opencv2/objdetect/erfilter.hpp +++ b/modules/objdetect/include/opencv2/objdetect/erfilter.hpp @@ -164,6 +164,7 @@ public: \param cb Callback with the classifier. 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 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 @@ -188,12 +189,32 @@ CV_EXPORTS Ptr createERFilterNM1(const Ptr& cb = P \param cb Callback with the classifier 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 */ CV_EXPORTS Ptr createERFilterNM2(const Ptr& cb = Ptr(), 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 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 getDefaultClassifierNM2(); + + // computeNMChannels operation modes enum { ERFILTER_NM_RGBLGrad = 0, ERFILTER_NM_IHSGrad = 1 diff --git a/modules/objdetect/src/erfilter.cpp b/modules/objdetect/src/erfilter.cpp index c231a51..9365eab 100644 --- a/modules/objdetect/src/erfilter.cpp +++ b/modules/objdetect/src/erfilter.cpp @@ -1142,6 +1142,29 @@ Ptr createERFilterNM2(const Ptr& cb, float minProb return (Ptr)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 getDefaultClassifierNM1() + +{ + return makePtr(); +} + +/*! + 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 getDefaultClassifierNM2() +{ + return makePtr(); +} + /* ------------------------------------------------------------------------------------*/ /* -------------------------------- Compute Channels NM -------------------------------*/ -- 2.7.4