bindings.hpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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_IMGPROC_BINDINGS_HPP
  5. #define OPENCV_IMGPROC_BINDINGS_HPP
  6. // This file contains special overloads for OpenCV bindings
  7. // No need to use these functions in C++ code.
  8. namespace cv {
  9. /** @brief Finds lines in a binary image using the standard Hough transform and get accumulator.
  10. *
  11. * @note This function is for bindings use only. Use original function in C++ code
  12. *
  13. * @sa HoughLines
  14. */
  15. CV_WRAP static inline
  16. void HoughLinesWithAccumulator(
  17. InputArray image, OutputArray lines,
  18. double rho, double theta, int threshold,
  19. double srn = 0, double stn = 0,
  20. double min_theta = 0, double max_theta = CV_PI,
  21. bool use_edgeval = false
  22. )
  23. {
  24. std::vector<Vec3f> lines_acc;
  25. HoughLines(image, lines_acc, rho, theta, threshold, srn, stn, min_theta, max_theta, use_edgeval);
  26. Mat(lines_acc).copyTo(lines);
  27. }
  28. /** @brief Finds circles in a grayscale image using the Hough transform and get accumulator.
  29. *
  30. * @note This function is for bindings use only. Use original function in C++ code
  31. *
  32. * @sa HoughCircles
  33. */
  34. CV_WRAP static inline
  35. void HoughCirclesWithAccumulator(
  36. InputArray image, OutputArray circles,
  37. int method, double dp, double minDist,
  38. double param1 = 100, double param2 = 100,
  39. int minRadius = 0, int maxRadius = 0
  40. )
  41. {
  42. std::vector<Vec4f> circles_acc;
  43. HoughCircles(image, circles_acc, method, dp, minDist, param1, param2, minRadius, maxRadius);
  44. Mat(1, static_cast<int>(circles_acc.size()), CV_32FC4, &circles_acc.front()).copyTo(circles);
  45. }
  46. } // namespace
  47. #endif // OPENCV_IMGPROC_BINDINGS_HPP