diff --git a/src/zm_detector.cpp b/src/zm_detector.cpp index c8d8dd5bf..fca106ec1 100644 --- a/src/zm_detector.cpp +++ b/src/zm_detector.cpp @@ -94,7 +94,7 @@ void Detector::log(int nLogLevel, string sLevel, string sMessage) * \param score is the detection score * \return true if detection is effective */ -bool Detector::Detect(const Image* zmImage, Zone** zones, Event::StringSet &zoneSet, unsigned int &score) +bool Detector::Detect(const Image &zmImage, Zone** zones, Event::StringSet &zoneSet, unsigned int &score) { bool alarm = false; char szMessage[100]; @@ -112,7 +112,7 @@ bool Detector::Detect(const Image* zmImage, Zone** zones, Event::StringSet &zone continue; sprintf(szMessage, "Checking preclusive zone %s", zone->Label()); log(LOG_DEBUG, "DEBUG", szMessage); - if (checkZone(zone, *it, *zmImage)) + if (checkZone(zone, *it, &zmImage)) { alarm = true; score += zone->Score(); @@ -145,7 +145,7 @@ bool Detector::Detect(const Image* zmImage, Zone** zones, Event::StringSet &zone continue; if (zone->IsPostProcEnabled() && !zone->IsPostProcInProgress()) continue; - if (checkZone(zone, *it, *zmImage)) + if (checkZone(zone, *it, &zmImage)) { alarm = true; score += zone->Score(); @@ -176,7 +176,7 @@ bool Detector::Detect(const Image* zmImage, Zone** zones, Event::StringSet &zone continue; sprintf(szMessage, "Checking inclusive zone %s", zone->Label()); log(LOG_DEBUG, "DEBUG", szMessage); - if (checkZone(zone, *it, *zmImage)) + if (checkZone(zone, *it, &zmImage)) { alarm = true; score += zone->Score(); @@ -207,7 +207,7 @@ bool Detector::Detect(const Image* zmImage, Zone** zones, Event::StringSet &zone continue; sprintf(szMessage, "Checking exclusive zone %s", zone->Label()); log(LOG_DEBUG, "DEBUG", szMessage); - if (checkZone(zone, *it, *zmImage)) + if (checkZone(zone, *it, &zmImage)) { alarm = true; score += zone->Score(); diff --git a/src/zm_detector.h b/src/zm_detector.h index b82e6f1b0..9850bda6d 100644 --- a/src/zm_detector.h +++ b/src/zm_detector.h @@ -76,7 +76,7 @@ public: Detector& operator=(const Detector& source); //! Detect (in an image later) - bool Detect(const Image* image, Zone** zones, Event::StringSet &zoneSet, unsigned int &score); + bool Detect(const Image &image, Zone** zones, Event::StringSet &zoneSet, unsigned int &score); //! Load detector's parameters. virtual int loadConfig(string sConfigFileName, map > mapPluginConf) = 0; diff --git a/src/zm_image_analyser.cpp b/src/zm_image_analyser.cpp index 9d51b514e..20e02fda6 100644 --- a/src/zm_image_analyser.cpp +++ b/src/zm_image_analyser.cpp @@ -61,7 +61,7 @@ bool ImageAnalyser::DoDetection(const Image &comp_image, Zone** zones, Event::St ++It ) { unsigned int detect_score = 0; - if ( (*It)->Detect( &comp_image, zones, zoneSet, detect_score ) ) + if ( (*It)->Detect( comp_image, zones, zoneSet, detect_score ) ) { alarm = true; score += detect_score;