LineSegmentDetector.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. //
  2. // This file is auto-generated. Please don't modify it!
  3. //
  4. #pragma once
  5. #ifdef __cplusplus
  6. //#import "opencv.hpp"
  7. #import "opencv2/imgproc.hpp"
  8. #else
  9. #define CV_EXPORTS
  10. #endif
  11. #import <Foundation/Foundation.h>
  12. #import "Algorithm.h"
  13. @class Mat;
  14. @class Size2i;
  15. NS_ASSUME_NONNULL_BEGIN
  16. // C++: class LineSegmentDetector
  17. /**
  18. * Line segment detector class
  19. *
  20. * following the algorithm described at CITE: Rafael12 .
  21. *
  22. * NOTE: Implementation has been removed from OpenCV version 3.4.6 to 3.4.15 and version 4.1.0 to 4.5.3 due original code license conflict.
  23. * restored again after [Computation of a NFA](https://github.com/rafael-grompone-von-gioi/binomial_nfa) code published under the MIT license.
  24. *
  25. * Member of `Imgproc`
  26. */
  27. CV_EXPORTS @interface LineSegmentDetector : Algorithm
  28. #ifdef __cplusplus
  29. @property(readonly)cv::Ptr<cv::LineSegmentDetector> nativePtrLineSegmentDetector;
  30. #endif
  31. #ifdef __cplusplus
  32. - (instancetype)initWithNativePtr:(cv::Ptr<cv::LineSegmentDetector>)nativePtr;
  33. + (instancetype)fromNative:(cv::Ptr<cv::LineSegmentDetector>)nativePtr;
  34. #endif
  35. #pragma mark - Methods
  36. //
  37. // void cv::LineSegmentDetector::detect(Mat image, Mat& lines, Mat& width = Mat(), Mat& prec = Mat(), Mat& nfa = Mat())
  38. //
  39. /**
  40. * Finds lines in the input image.
  41. *
  42. * This is the output of the default parameters of the algorithm on the above shown image.
  43. *
  44. * ![image](pics/building_lsd.png)
  45. *
  46. * @param image A grayscale (CV_8UC1) input image. If only a roi needs to be selected, use:
  47. * `lsd_ptr-\>detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);`
  48. * @param lines A vector of Vec4f elements specifying the beginning and ending point of a line. Where
  49. * Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 - end. Returned lines are strictly
  50. * oriented depending on the gradient.
  51. * @param width Vector of widths of the regions, where the lines are found. E.g. Width of line.
  52. * @param prec Vector of precisions with which the lines are found.
  53. * @param nfa Vector containing number of false alarms in the line region, with precision of 10%. The
  54. * bigger the value, logarithmically better the detection.
  55. * - -1 corresponds to 10 mean false alarms
  56. * - 0 corresponds to 1 mean false alarm
  57. * - 1 corresponds to 0.1 mean false alarms
  58. * This vector will be calculated only when the objects type is #LSD_REFINE_ADV.
  59. */
  60. - (void)detect:(Mat*)image lines:(Mat*)lines width:(Mat*)width prec:(Mat*)prec nfa:(Mat*)nfa NS_SWIFT_NAME(detect(image:lines:width:prec:nfa:));
  61. /**
  62. * Finds lines in the input image.
  63. *
  64. * This is the output of the default parameters of the algorithm on the above shown image.
  65. *
  66. * ![image](pics/building_lsd.png)
  67. *
  68. * @param image A grayscale (CV_8UC1) input image. If only a roi needs to be selected, use:
  69. * `lsd_ptr-\>detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);`
  70. * @param lines A vector of Vec4f elements specifying the beginning and ending point of a line. Where
  71. * Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 - end. Returned lines are strictly
  72. * oriented depending on the gradient.
  73. * @param width Vector of widths of the regions, where the lines are found. E.g. Width of line.
  74. * @param prec Vector of precisions with which the lines are found.
  75. * bigger the value, logarithmically better the detection.
  76. * - -1 corresponds to 10 mean false alarms
  77. * - 0 corresponds to 1 mean false alarm
  78. * - 1 corresponds to 0.1 mean false alarms
  79. * This vector will be calculated only when the objects type is #LSD_REFINE_ADV.
  80. */
  81. - (void)detect:(Mat*)image lines:(Mat*)lines width:(Mat*)width prec:(Mat*)prec NS_SWIFT_NAME(detect(image:lines:width:prec:));
  82. /**
  83. * Finds lines in the input image.
  84. *
  85. * This is the output of the default parameters of the algorithm on the above shown image.
  86. *
  87. * ![image](pics/building_lsd.png)
  88. *
  89. * @param image A grayscale (CV_8UC1) input image. If only a roi needs to be selected, use:
  90. * `lsd_ptr-\>detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);`
  91. * @param lines A vector of Vec4f elements specifying the beginning and ending point of a line. Where
  92. * Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 - end. Returned lines are strictly
  93. * oriented depending on the gradient.
  94. * @param width Vector of widths of the regions, where the lines are found. E.g. Width of line.
  95. * bigger the value, logarithmically better the detection.
  96. * - -1 corresponds to 10 mean false alarms
  97. * - 0 corresponds to 1 mean false alarm
  98. * - 1 corresponds to 0.1 mean false alarms
  99. * This vector will be calculated only when the objects type is #LSD_REFINE_ADV.
  100. */
  101. - (void)detect:(Mat*)image lines:(Mat*)lines width:(Mat*)width NS_SWIFT_NAME(detect(image:lines:width:));
  102. /**
  103. * Finds lines in the input image.
  104. *
  105. * This is the output of the default parameters of the algorithm on the above shown image.
  106. *
  107. * ![image](pics/building_lsd.png)
  108. *
  109. * @param image A grayscale (CV_8UC1) input image. If only a roi needs to be selected, use:
  110. * `lsd_ptr-\>detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);`
  111. * @param lines A vector of Vec4f elements specifying the beginning and ending point of a line. Where
  112. * Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 - end. Returned lines are strictly
  113. * oriented depending on the gradient.
  114. * bigger the value, logarithmically better the detection.
  115. * - -1 corresponds to 10 mean false alarms
  116. * - 0 corresponds to 1 mean false alarm
  117. * - 1 corresponds to 0.1 mean false alarms
  118. * This vector will be calculated only when the objects type is #LSD_REFINE_ADV.
  119. */
  120. - (void)detect:(Mat*)image lines:(Mat*)lines NS_SWIFT_NAME(detect(image:lines:));
  121. //
  122. // void cv::LineSegmentDetector::drawSegments(Mat& image, Mat lines)
  123. //
  124. /**
  125. * Draws the line segments on a given image.
  126. * @param image The image, where the lines will be drawn. Should be bigger or equal to the image,
  127. * where the lines were found.
  128. * @param lines A vector of the lines that needed to be drawn.
  129. */
  130. - (void)drawSegments:(Mat*)image lines:(Mat*)lines NS_SWIFT_NAME(drawSegments(image:lines:));
  131. //
  132. // int cv::LineSegmentDetector::compareSegments(Size size, Mat lines1, Mat lines2, Mat& image = Mat())
  133. //
  134. /**
  135. * Draws two groups of lines in blue and red, counting the non overlapping (mismatching) pixels.
  136. *
  137. * @param size The size of the image, where lines1 and lines2 were found.
  138. * @param lines1 The first group of lines that needs to be drawn. It is visualized in blue color.
  139. * @param lines2 The second group of lines. They visualized in red color.
  140. * @param image Optional image, where the lines will be drawn. The image should be color(3-channel)
  141. * in order for lines1 and lines2 to be drawn in the above mentioned colors.
  142. */
  143. - (int)compareSegments:(Size2i*)size lines1:(Mat*)lines1 lines2:(Mat*)lines2 image:(Mat*)image NS_SWIFT_NAME(compareSegments(size:lines1:lines2:image:));
  144. /**
  145. * Draws two groups of lines in blue and red, counting the non overlapping (mismatching) pixels.
  146. *
  147. * @param size The size of the image, where lines1 and lines2 were found.
  148. * @param lines1 The first group of lines that needs to be drawn. It is visualized in blue color.
  149. * @param lines2 The second group of lines. They visualized in red color.
  150. * in order for lines1 and lines2 to be drawn in the above mentioned colors.
  151. */
  152. - (int)compareSegments:(Size2i*)size lines1:(Mat*)lines1 lines2:(Mat*)lines2 NS_SWIFT_NAME(compareSegments(size:lines1:lines2:));
  153. @end
  154. NS_ASSUME_NONNULL_END