radial_variance_hash.hpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // This file is part of OpenCV project.
  2. // It is subject to the license terms in the LICENSE file found in the top-level directory
  3. // of this distribution and at http://opencv.org/license.html.
  4. #ifndef OPENCV_RADIAL_VARIANCE_HASH_HPP
  5. #define OPENCV_RADIAL_VARIANCE_HASH_HPP
  6. #include "img_hash_base.hpp"
  7. namespace cv {
  8. namespace img_hash {
  9. //! @addtogroup img_hash
  10. //! @{
  11. /** @brief Image hash based on Radon transform.
  12. See @cite tang2012perceptual for details.
  13. */
  14. class CV_EXPORTS_W RadialVarianceHash : public ImgHashBase
  15. {
  16. public:
  17. CV_WRAP static Ptr<RadialVarianceHash> create(double sigma = 1, int numOfAngleLine = 180);
  18. CV_WRAP int getNumOfAngleLine() const;
  19. CV_WRAP double getSigma() const;
  20. CV_WRAP void setNumOfAngleLine(int value);
  21. CV_WRAP void setSigma(double value);
  22. // internals
  23. std::vector<double> getFeatures();
  24. cv::Mat getHash();
  25. Mat getPixPerLine(Mat const &input);
  26. Mat getProjection();
  27. protected:
  28. RadialVarianceHash() {}
  29. };
  30. /** @brief Computes radial variance hash of the input image
  31. @param inputArr input image want to compute hash value,
  32. type should be CV_8UC4, CV_8UC3, CV_8UC1.
  33. @param outputArr Hash value of input
  34. @param sigma Gaussian kernel standard deviation
  35. @param numOfAngleLine The number of angles to consider
  36. */
  37. CV_EXPORTS_W void radialVarianceHash(cv::InputArray inputArr,
  38. cv::OutputArray outputArr,
  39. double sigma = 1,
  40. int numOfAngleLine = 180);
  41. //! @}
  42. }} // cv::img_hash::
  43. #endif // OPENCV_RADIAL_VARIANCE_HASH_HPP