marr_hildreth_hash.hpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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_MARR_HILDRETH_HASH_HPP
  5. #define OPENCV_MARR_HILDRETH_HASH_HPP
  6. #include "img_hash_base.hpp"
  7. namespace cv {
  8. namespace img_hash {
  9. //! @addtogroup img_hash
  10. //! @{
  11. /** @brief Marr-Hildreth Operator Based Hash, slowest but more discriminative.
  12. See @cite zauner2010implementation for details.
  13. */
  14. class CV_EXPORTS_W MarrHildrethHash : public ImgHashBase
  15. {
  16. public:
  17. /**
  18. * @brief self explain
  19. */
  20. CV_WRAP float getAlpha() const;
  21. /**
  22. * @brief self explain
  23. */
  24. CV_WRAP float getScale() const;
  25. /** @brief Set Mh kernel parameters
  26. @param alpha int scale factor for marr wavelet (default=2).
  27. @param scale int level of scale factor (default = 1)
  28. */
  29. CV_WRAP void setKernelParam(float alpha, float scale);
  30. /**
  31. @param alpha int scale factor for marr wavelet (default=2).
  32. @param scale int level of scale factor (default = 1)
  33. */
  34. CV_WRAP static Ptr<MarrHildrethHash> create(float alpha = 2.0f, float scale = 1.0f);
  35. protected:
  36. MarrHildrethHash() {}
  37. };
  38. /** @brief Computes average hash value of the input image
  39. @param inputArr input image want to compute hash value,
  40. type should be CV_8UC4, CV_8UC3, CV_8UC1.
  41. @param outputArr Hash value of input, it will contain 16 hex
  42. decimal number, return type is CV_8U
  43. @param alpha int scale factor for marr wavelet (default=2).
  44. @param scale int level of scale factor (default = 1)
  45. */
  46. CV_EXPORTS_W void marrHildrethHash(cv::InputArray inputArr,
  47. cv::OutputArray outputArr,
  48. float alpha = 2.0f, float scale = 1.0f);
  49. //! @}
  50. }} // cv::img_hash::
  51. #endif // OPENCV_MARR_HILDRETH_HASH_HPP