mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-18 08:44:11 +08:00
img_hash: apply CV_OVERRIDE/CV_FINAL
This commit is contained in:
@@ -10,7 +10,7 @@ using namespace img_hash;
|
||||
|
||||
namespace {
|
||||
|
||||
class AverageHashImpl : public ImgHashBase::ImgHashImpl
|
||||
class AverageHashImpl CV_FINAL : public ImgHashBase::ImgHashImpl
|
||||
{
|
||||
private:
|
||||
cv::Mat bitsImg;
|
||||
@@ -19,7 +19,7 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr)
|
||||
virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr) CV_OVERRIDE
|
||||
{
|
||||
cv::Mat const input = inputArr.getMat();
|
||||
CV_Assert(input.type() == CV_8UC4 ||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const
|
||||
virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const CV_OVERRIDE
|
||||
{
|
||||
return norm(hashOne, hashTwo, NORM_HAMMING);
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ enum
|
||||
colSize = imgWidth - blockWidth
|
||||
};
|
||||
|
||||
class BlockMeanHashImpl : public ImgHashBase::ImgHashImpl
|
||||
class BlockMeanHashImpl CV_FINAL : public ImgHashBase::ImgHashImpl
|
||||
{
|
||||
public:
|
||||
BlockMeanHashImpl(int mode)
|
||||
@@ -30,9 +30,9 @@ public:
|
||||
setMode(mode);
|
||||
}
|
||||
|
||||
~BlockMeanHashImpl() {}
|
||||
~BlockMeanHashImpl() CV_OVERRIDE {}
|
||||
|
||||
virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr)
|
||||
virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr) CV_OVERRIDE
|
||||
{
|
||||
cv::Mat const input = inputArr.getMat();
|
||||
CV_Assert(input.type() == CV_8UC4 ||
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
createHash(hash);
|
||||
}
|
||||
|
||||
virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const
|
||||
virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const CV_OVERRIDE
|
||||
{
|
||||
return norm(hashOne, hashTwo, NORM_HAMMING);
|
||||
}
|
||||
|
@@ -10,12 +10,12 @@ using namespace std;
|
||||
|
||||
namespace {
|
||||
|
||||
class ColorMomentHashImpl : public ImgHashBase::ImgHashImpl
|
||||
class ColorMomentHashImpl CV_FINAL : public ImgHashBase::ImgHashImpl
|
||||
{
|
||||
public:
|
||||
~ColorMomentHashImpl() {}
|
||||
~ColorMomentHashImpl() CV_OVERRIDE {}
|
||||
|
||||
virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr)
|
||||
virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr) CV_OVERRIDE
|
||||
{
|
||||
cv::Mat const input = inputArr.getMat();
|
||||
CV_Assert(input.type() == CV_8UC4 ||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
computeMoments(hash.ptr<double>(0) + 21);
|
||||
}
|
||||
|
||||
virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const
|
||||
virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const CV_OVERRIDE
|
||||
{
|
||||
return norm(hashOne, hashTwo, NORM_L2) * 10000;
|
||||
}
|
||||
|
@@ -86,7 +86,7 @@ void createHash(cv::Mat const &blocks, cv::Mat &hash)
|
||||
}
|
||||
}
|
||||
|
||||
class MarrHildrethHashImpl : public ImgHashBase::ImgHashImpl
|
||||
class MarrHildrethHashImpl CV_FINAL : public ImgHashBase::ImgHashImpl
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -96,9 +96,9 @@ public:
|
||||
blocks.create(31,31, CV_32F);
|
||||
}
|
||||
|
||||
~MarrHildrethHashImpl() { }
|
||||
~MarrHildrethHashImpl() CV_OVERRIDE { }
|
||||
|
||||
virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr)
|
||||
virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr) CV_OVERRIDE
|
||||
{
|
||||
cv::Mat const input = inputArr.getMat();
|
||||
CV_Assert(input.type() == CV_8UC4 ||
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
createHash(blocks, hash);
|
||||
}
|
||||
|
||||
virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const
|
||||
virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const CV_OVERRIDE
|
||||
{
|
||||
return norm(hashOne, hashTwo, NORM_HAMMING);
|
||||
}
|
||||
|
@@ -10,10 +10,10 @@ using namespace std;
|
||||
|
||||
namespace {
|
||||
|
||||
class PHashImpl : public ImgHashBase::ImgHashImpl
|
||||
class PHashImpl CV_FINAL : public ImgHashBase::ImgHashImpl
|
||||
{
|
||||
public:
|
||||
virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr)
|
||||
virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr) CV_OVERRIDE
|
||||
{
|
||||
cv::Mat const input = inputArr.getMat();
|
||||
CV_Assert(input.type() == CV_8UC4 ||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const
|
||||
virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const CV_OVERRIDE
|
||||
{
|
||||
return norm(hashOne, hashTwo, NORM_HAMMING);
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ inline int createOffSet(int length)
|
||||
return static_cast<int>(std::floor(center + roundingFactor(center)));
|
||||
}
|
||||
|
||||
class RadialVarianceHashImpl : public ImgHashBase::ImgHashImpl
|
||||
class RadialVarianceHashImpl CV_FINAL : public ImgHashBase::ImgHashImpl
|
||||
{
|
||||
public:
|
||||
cv::Mat blurImg_;
|
||||
@@ -42,9 +42,9 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
~RadialVarianceHashImpl() {}
|
||||
~RadialVarianceHashImpl() CV_OVERRIDE {}
|
||||
|
||||
virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr)
|
||||
virtual void compute(cv::InputArray inputArr, cv::OutputArray outputArr) CV_OVERRIDE
|
||||
{
|
||||
cv::Mat const input = inputArr.getMat();
|
||||
CV_Assert(input.type() == CV_8UC4 ||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
hashCalculate(hash);
|
||||
}
|
||||
|
||||
virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const
|
||||
virtual double compare(cv::InputArray hashOne, cv::InputArray hashTwo) const CV_OVERRIDE
|
||||
{
|
||||
cv::Mat const hashOneF = hashOne.getMat();
|
||||
cv::Mat const hashTwoF = hashTwo.getMat();
|
||||
|
Reference in New Issue
Block a user