123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- /*M
- #ifndef __OPENCV_FAST_HOUGH_TRANSFORM_HPP__
- #define __OPENCV_FAST_HOUGH_TRANSFORM_HPP__
- #ifdef __cplusplus
- #include "opencv2/core.hpp"
- namespace cv { namespace ximgproc {
- /**
- * @brief Specifies the part of Hough space to calculate
- * @details The enum specifies the part of Hough space to calculate. Each
- * member specifies primarily direction of lines (horizontal or vertical)
- * and the direction of angle changes.
- * Direction of angle changes is from multiples of 90 to odd multiples of 45.
- * The image considered to be written top-down and left-to-right.
- * Angles are started from vertical line and go clockwise.
- * Separate quarters and halves are written in orientation they should be in
- * full Hough space.
- */
- enum AngleRangeOption
- {
- ARO_0_45 = 0,
- ARO_45_90 = 1,
- ARO_90_135 = 2,
- ARO_315_0 = 3,
- ARO_315_45 = 4,
- ARO_45_135 = 5,
- ARO_315_135 = 6,
- ARO_CTR_HOR = 7,
-
- ARO_CTR_VER = 8
-
- };
- /**
- * @brief Specifies binary operations.
- * @details The enum specifies binary operations, that is such ones which involve
- * two operands. Formally, a binary operation @f$ f @f$ on a set @f$ S @f$
- * is a binary relation that maps elements of the Cartesian product
- * @f$ S \times S @f$ to @f$ S @f$:
- * @f[ f: S \times S \to S @f]
- * @ingroup MinUtils_MathOper
- */
- enum HoughOp
- {
- FHT_MIN = 0,
-
- FHT_MAX = 1,
-
- FHT_ADD = 2,
-
- FHT_AVE = 3
-
- };
- /**
- * @brief Specifies to do or not to do skewing of Hough transform image
- * @details The enum specifies to do or not to do skewing of Hough transform image
- * so it would be no cycling in Hough transform image through borders of image.
- */
- enum HoughDeskewOption
- {
- HDO_RAW = 0,
- HDO_DESKEW = 1
- };
- /**
- * @brief Specifies the degree of rules validation.
- * @details The enum specifies the degree of rules validation. This can be used,
- * for example, to choose a proper way of input arguments validation.
- */
- typedef enum {
- RO_STRICT = 0x00,
- RO_IGNORE_BORDERS = 0x01,
- } RulesOption;
- /**
- * @brief Calculates 2D Fast Hough transform of an image.
- * @param dst The destination image, result of transformation.
- * @param src The source (input) image.
- * @param dstMatDepth The depth of destination image
- * @param op The operation to be applied, see cv::HoughOp
- * @param angleRange The part of Hough space to calculate, see cv::AngleRangeOption
- * @param makeSkew Specifies to do or not to do image skewing, see cv::HoughDeskewOption
- *
- * The function calculates the fast Hough transform for full, half or quarter
- * range of angles.
- */
- CV_EXPORTS void FastHoughTransform( InputArray src,
- OutputArray dst,
- int dstMatDepth,
- int angleRange = ARO_315_135,
- int op = FHT_ADD,
- int makeSkew = HDO_DESKEW );
- /**
- * @brief Calculates coordinates of line segment corresponded by point in Hough space.
- * @param houghPoint Point in Hough space.
- * @param srcImgInfo The source (input) image of Hough transform.
- * @param angleRange The part of Hough space where point is situated, see cv::AngleRangeOption
- * @param makeSkew Specifies to do or not to do image skewing, see cv::HoughDeskewOption
- * @param rules Specifies strictness of line segment calculating, see cv::RulesOption
- * @retval [Vec4i] Coordinates of line segment corresponded by point in Hough space.
- * @remarks If rules parameter set to RO_STRICT
- then returned line cut along the border of source image.
- * @remarks If rules parameter set to RO_WEAK then in case of point, which belongs
- the incorrect part of Hough image, returned line will not intersect source image.
- *
- * The function calculates coordinates of line segment corresponded by point in Hough space.
- */
- CV_EXPORTS Vec4i HoughPoint2Line(const Point &houghPoint,
- InputArray srcImgInfo,
- int angleRange = ARO_315_135,
- int makeSkew = HDO_DESKEW,
- int rules = RO_IGNORE_BORDERS );
- } }
- #endif
- #endif
|