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