From 21d563c02fca2a1bdbf1687f49667f9252f355a2 Mon Sep 17 00:00:00 2001 From: jaco Date: Tue, 29 Jul 2014 17:21:36 +0200 Subject: [PATCH] wip compile error fixing --- .../include/opencv2/saliency/FilterTIG.h | 24 +++++++++---------- .../opencv2/saliency/saliencyBaseClasses.hpp | 14 ++++------- modules/saliency/src/motionSaliency.cpp | 1 - modules/saliency/src/objectness.cpp | 1 - modules/saliency/src/saliency_init.cpp | 2 +- modules/saliency/src/staticSaliency.cpp | 3 +-- 6 files changed, 19 insertions(+), 26 deletions(-) diff --git a/modules/saliency/include/opencv2/saliency/FilterTIG.h b/modules/saliency/include/opencv2/saliency/FilterTIG.h index 6891cf770..9ca24b90c 100644 --- a/modules/saliency/include/opencv2/saliency/FilterTIG.h +++ b/modules/saliency/include/opencv2/saliency/FilterTIG.h @@ -67,20 +67,20 @@ private: inline float FilterTIG::dot(const INT64 tig1, const INT64 tig2, const INT64 tig4, const INT64 tig8) { - INT64 bcT1 = POPCNT64(tig1); - INT64 bcT2 = POPCNT64(tig2); - INT64 bcT4 = POPCNT64(tig4); - INT64 bcT8 = POPCNT64(tig8); + INT64 bcT1 = (INT64)POPCNT64(tig1); + INT64 bcT2 = (INT64)POPCNT64(tig2); + INT64 bcT4 = (INT64)POPCNT64(tig4); + INT64 bcT8 = (INT64)POPCNT64(tig8); - INT64 bc01 = (POPCNT64(_bTIGs[0] & tig1) << 1) - bcT1; - INT64 bc02 = ((POPCNT64(_bTIGs[0] & tig2) << 1) - bcT2) << 1; - INT64 bc04 = ((POPCNT64(_bTIGs[0] & tig4) << 1) - bcT4) << 2; - INT64 bc08 = ((POPCNT64(_bTIGs[0] & tig8) << 1) - bcT8) << 3; + INT64 bc01 = (INT64)(POPCNT64(_bTIGs[0] & tig1) << 1) - bcT1; + INT64 bc02 = (INT64)((POPCNT64(_bTIGs[0] & tig2) << 1) - bcT2) << 1; + INT64 bc04 = (INT64)((POPCNT64(_bTIGs[0] & tig4) << 1) - bcT4) << 2; + INT64 bc08 = (INT64)((POPCNT64(_bTIGs[0] & tig8) << 1) - bcT8) << 3; - INT64 bc11 = (POPCNT64(_bTIGs[1] & tig1) << 1) - bcT1; - INT64 bc12 = ((POPCNT64(_bTIGs[1] & tig2) << 1) - bcT2) << 1; - INT64 bc14 = ((POPCNT64(_bTIGs[1] & tig4) << 1) - bcT4) << 2; - INT64 bc18 = ((POPCNT64(_bTIGs[1] & tig8) << 1) - bcT8) << 3; + INT64 bc11 = (INT64)(POPCNT64(_bTIGs[1] & tig1) << 1) - bcT1; + INT64 bc12 = (INT64)((POPCNT64(_bTIGs[1] & tig2) << 1) - bcT2) << 1; + INT64 bc14 = (INT64)((POPCNT64(_bTIGs[1] & tig4) << 1) - bcT4) << 2; + INT64 bc18 = (INT64)((POPCNT64(_bTIGs[1] & tig8) << 1) - bcT8) << 3; return _coeffs1[0] * (bc01 + bc02 + bc04 + bc08) + _coeffs1[1] * (bc11 + bc12 + bc14 + bc18); } diff --git a/modules/saliency/include/opencv2/saliency/saliencyBaseClasses.hpp b/modules/saliency/include/opencv2/saliency/saliencyBaseClasses.hpp index 780ba9fd9..861f5ff80 100644 --- a/modules/saliency/include/opencv2/saliency/saliencyBaseClasses.hpp +++ b/modules/saliency/include/opencv2/saliency/saliencyBaseClasses.hpp @@ -94,30 +94,26 @@ class CV_EXPORTS_W StaticSaliency : public virtual Saliency public: bool computeBinaryMap( const Mat& saliencyMap, Mat& binaryMap ); - AlgorithmInfo* info() const = 0; protected: - virtual bool computeSaliencyImpl( const InputArray image, OutputArray saliencyMap ) = 0; + virtual bool computeSaliencyImpl( const InputArray image, OutputArray saliencyMap )=0; }; /************************************ Motion Saliency Base Class ************************************/ class CV_EXPORTS_W MotionSaliency : public virtual Saliency { - public: - AlgorithmInfo* info() const = 0; - protected: - virtual bool computeSaliencyImpl( const InputArray image, OutputArray saliencyMap ) = 0; + protected: + virtual bool computeSaliencyImpl( const InputArray image, OutputArray saliencyMap )=0; }; /************************************ Objectness Base Class ************************************/ class CV_EXPORTS_W Objectness : public virtual Saliency { - public: - AlgorithmInfo* info() const = 0; + protected: - virtual bool computeSaliencyImpl( const InputArray image, OutputArray saliencyMap ) = 0; + virtual bool computeSaliencyImpl( const InputArray image, OutputArray saliencyMap )=0; }; diff --git a/modules/saliency/src/motionSaliency.cpp b/modules/saliency/src/motionSaliency.cpp index 7ed29c9cc..29c25858c 100644 --- a/modules/saliency/src/motionSaliency.cpp +++ b/modules/saliency/src/motionSaliency.cpp @@ -48,5 +48,4 @@ namespace cv * Motion Saliency */ - }/* namespace cv */ diff --git a/modules/saliency/src/objectness.cpp b/modules/saliency/src/objectness.cpp index ea5dea513..4b210185f 100644 --- a/modules/saliency/src/objectness.cpp +++ b/modules/saliency/src/objectness.cpp @@ -48,5 +48,4 @@ namespace cv * Objectness */ - }/* namespace cv */ diff --git a/modules/saliency/src/saliency_init.cpp b/modules/saliency/src/saliency_init.cpp index 6396467ac..eb49a14f0 100644 --- a/modules/saliency/src/saliency_init.cpp +++ b/modules/saliency/src/saliency_init.cpp @@ -58,11 +58,11 @@ CV_INIT_ALGORITHM( ObjectnessBING, "SALIENCY.BING", obj.info()->addParam(obj, "_base", obj._base); obj.info()->addParam(obj, "_NSS", obj._NSS); obj.info()->addParam(obj, "_W", obj._W) ); + bool initModule_saliency( void ) { bool all = true; all &= !StaticSaliencySpectralResidual_info_auto.name().empty(); - //all &= !MotionSaliencySuBSENSE_info_auto.name().empty(); all &= !ObjectnessBING_info_auto.name().empty(); return all; diff --git a/modules/saliency/src/staticSaliency.cpp b/modules/saliency/src/staticSaliency.cpp index 799277d93..0c4596cf9 100644 --- a/modules/saliency/src/staticSaliency.cpp +++ b/modules/saliency/src/staticSaliency.cpp @@ -48,7 +48,6 @@ namespace cv * StaticSaliency */ - bool StaticSaliency::computeBinaryMap( const Mat& saliencyMap, Mat& BinaryMap ) { @@ -87,7 +86,7 @@ bool StaticSaliency::computeBinaryMap( const Mat& saliencyMap, Mat& BinaryMap ) //Convert outputMat = outputMat * 255; outputMat.convertTo( outputMat, CV_8U ); - //saliencyMap = outputMat; + //saliencyMap = outputMat; // adaptative thresholding using Otsu's method, to make saliency map binary threshold( outputMat, BinaryMap, 0, 255, THRESH_BINARY | THRESH_OTSU );