LineSegmentDetector.html 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!-- NewPage -->
  3. <html lang="en">
  4. <head>
  5. <!-- Generated by javadoc (1.8.0_312) on Wed Jun 28 12:47:25 UTC 2023 -->
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. <title>LineSegmentDetector (OpenCV 4.8.0 Java documentation)</title>
  8. <meta name="date" content="2023-06-28">
  9. <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
  10. <script type="text/javascript" src="../../../script.js"></script>
  11. </head>
  12. <body>
  13. <script type="text/javascript"><!--
  14. try {
  15. if (location.href.indexOf('is-external=true') == -1) {
  16. parent.document.title="LineSegmentDetector (OpenCV 4.8.0 Java documentation)";
  17. }
  18. }
  19. catch(err) {
  20. }
  21. //-->
  22. var methods = {"i0":9,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10};
  23. var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
  24. var altColor = "altColor";
  25. var rowColor = "rowColor";
  26. var tableTab = "tableTab";
  27. var activeTableTab = "activeTableTab";
  28. </script>
  29. <noscript>
  30. <div>JavaScript is disabled on your browser.</div>
  31. </noscript>
  32. <!-- ========= START OF TOP NAVBAR ======= -->
  33. <div class="topNav"><a name="navbar.top">
  34. <!-- -->
  35. </a>
  36. <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
  37. <a name="navbar.top.firstrow">
  38. <!-- -->
  39. </a>
  40. <ul class="navList" title="Navigation">
  41. <li><a href="../../../overview-summary.html">Overview</a></li>
  42. <li><a href="package-summary.html">Package</a></li>
  43. <li class="navBarCell1Rev">Class</li>
  44. <li><a href="package-tree.html">Tree</a></li>
  45. <li><a href="../../../index-all.html">Index</a></li>
  46. <li><a href="../../../help-doc.html">Help</a></li>
  47. </ul>
  48. <div class="aboutLanguage">
  49. <script>
  50. var url = window.location.href;
  51. var pos = url.lastIndexOf('/javadoc/');
  52. url = pos >= 0 ? (url.substring(0, pos) + '/javadoc/mymath.js') : (window.location.origin + '/mymath.js');
  53. var script = document.createElement('script');
  54. script.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML,' + url;
  55. document.getElementsByTagName('head')[0].appendChild(script);
  56. </script>
  57. </div>
  58. </div>
  59. <div class="subNav">
  60. <ul class="navList">
  61. <li><a href="../../../org/opencv/imgproc/IntelligentScissorsMB.html" title="class in org.opencv.imgproc"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  62. <li><a href="../../../org/opencv/imgproc/Moments.html" title="class in org.opencv.imgproc"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  63. </ul>
  64. <ul class="navList">
  65. <li><a href="../../../index.html?org/opencv/imgproc/LineSegmentDetector.html" target="_top">Frames</a></li>
  66. <li><a href="LineSegmentDetector.html" target="_top">No&nbsp;Frames</a></li>
  67. </ul>
  68. <ul class="navList" id="allclasses_navbar_top">
  69. <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  70. </ul>
  71. <div>
  72. <script type="text/javascript"><!--
  73. allClassesLink = document.getElementById("allclasses_navbar_top");
  74. if(window==top) {
  75. allClassesLink.style.display = "block";
  76. }
  77. else {
  78. allClassesLink.style.display = "none";
  79. }
  80. //-->
  81. </script>
  82. </div>
  83. <div>
  84. <ul class="subNavList">
  85. <li>Summary:&nbsp;</li>
  86. <li>Nested&nbsp;|&nbsp;</li>
  87. <li>Field&nbsp;|&nbsp;</li>
  88. <li>Constr&nbsp;|&nbsp;</li>
  89. <li><a href="#method.summary">Method</a></li>
  90. </ul>
  91. <ul class="subNavList">
  92. <li>Detail:&nbsp;</li>
  93. <li>Field&nbsp;|&nbsp;</li>
  94. <li>Constr&nbsp;|&nbsp;</li>
  95. <li><a href="#method.detail">Method</a></li>
  96. </ul>
  97. </div>
  98. <a name="skip.navbar.top">
  99. <!-- -->
  100. </a></div>
  101. <!-- ========= END OF TOP NAVBAR ========= -->
  102. <!-- ======== START OF CLASS DATA ======== -->
  103. <div class="header">
  104. <div class="subTitle">org.opencv.imgproc</div>
  105. <h2 title="Class LineSegmentDetector" class="title">Class LineSegmentDetector</h2>
  106. </div>
  107. <div class="contentContainer">
  108. <ul class="inheritance">
  109. <li>java.lang.Object</li>
  110. <li>
  111. <ul class="inheritance">
  112. <li><a href="../../../org/opencv/core/Algorithm.html" title="class in org.opencv.core">org.opencv.core.Algorithm</a></li>
  113. <li>
  114. <ul class="inheritance">
  115. <li>org.opencv.imgproc.LineSegmentDetector</li>
  116. </ul>
  117. </li>
  118. </ul>
  119. </li>
  120. </ul>
  121. <div class="description">
  122. <ul class="blockList">
  123. <li class="blockList">
  124. <hr>
  125. <br>
  126. <pre>public class <span class="typeNameLabel">LineSegmentDetector</span>
  127. extends <a href="../../../org/opencv/core/Algorithm.html" title="class in org.opencv.core">Algorithm</a></pre>
  128. <div class="block">Line segment detector class
  129. following the algorithm described at CITE: Rafael12 .
  130. <b>Note:</b> 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.
  131. restored again after [Computation of a NFA](https://github.com/rafael-grompone-von-gioi/binomial_nfa) code published under the MIT license.</div>
  132. </li>
  133. </ul>
  134. </div>
  135. <div class="summary">
  136. <ul class="blockList">
  137. <li class="blockList">
  138. <!-- ========== METHOD SUMMARY =========== -->
  139. <ul class="blockList">
  140. <li class="blockList"><a name="method.summary">
  141. <!-- -->
  142. </a>
  143. <h3>Method Summary</h3>
  144. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  145. <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
  146. <tr>
  147. <th class="colFirst" scope="col">Modifier and Type</th>
  148. <th class="colLast" scope="col">Method and Description</th>
  149. </tr>
  150. <tr id="i0" class="altColor">
  151. <td class="colFirst"><code>static <a href="../../../org/opencv/imgproc/LineSegmentDetector.html" title="class in org.opencv.imgproc">LineSegmentDetector</a></code></td>
  152. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/imgproc/LineSegmentDetector.html#Z:Z__fromPtr__-long-">__fromPtr__</a></span>(long&nbsp;addr)</code>&nbsp;</td>
  153. </tr>
  154. <tr id="i1" class="rowColor">
  155. <td class="colFirst"><code>int</code></td>
  156. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/imgproc/LineSegmentDetector.html#compareSegments-org.opencv.core.Size-org.opencv.core.Mat-org.opencv.core.Mat-">compareSegments</a></span>(<a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;size,
  157. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;lines1,
  158. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;lines2)</code>
  159. <div class="block">Draws two groups of lines in blue and red, counting the non overlapping (mismatching) pixels.</div>
  160. </td>
  161. </tr>
  162. <tr id="i2" class="altColor">
  163. <td class="colFirst"><code>int</code></td>
  164. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/imgproc/LineSegmentDetector.html#compareSegments-org.opencv.core.Size-org.opencv.core.Mat-org.opencv.core.Mat-org.opencv.core.Mat-">compareSegments</a></span>(<a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;size,
  165. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;lines1,
  166. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;lines2,
  167. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image)</code>
  168. <div class="block">Draws two groups of lines in blue and red, counting the non overlapping (mismatching) pixels.</div>
  169. </td>
  170. </tr>
  171. <tr id="i3" class="rowColor">
  172. <td class="colFirst"><code>void</code></td>
  173. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/imgproc/LineSegmentDetector.html#detect-org.opencv.core.Mat-org.opencv.core.Mat-">detect</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image,
  174. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;lines)</code>
  175. <div class="block">Finds lines in the input image.</div>
  176. </td>
  177. </tr>
  178. <tr id="i4" class="altColor">
  179. <td class="colFirst"><code>void</code></td>
  180. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/imgproc/LineSegmentDetector.html#detect-org.opencv.core.Mat-org.opencv.core.Mat-org.opencv.core.Mat-">detect</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image,
  181. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;lines,
  182. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;width)</code>
  183. <div class="block">Finds lines in the input image.</div>
  184. </td>
  185. </tr>
  186. <tr id="i5" class="rowColor">
  187. <td class="colFirst"><code>void</code></td>
  188. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/imgproc/LineSegmentDetector.html#detect-org.opencv.core.Mat-org.opencv.core.Mat-org.opencv.core.Mat-org.opencv.core.Mat-">detect</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image,
  189. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;lines,
  190. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;width,
  191. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;prec)</code>
  192. <div class="block">Finds lines in the input image.</div>
  193. </td>
  194. </tr>
  195. <tr id="i6" class="altColor">
  196. <td class="colFirst"><code>void</code></td>
  197. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/imgproc/LineSegmentDetector.html#detect-org.opencv.core.Mat-org.opencv.core.Mat-org.opencv.core.Mat-org.opencv.core.Mat-org.opencv.core.Mat-">detect</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image,
  198. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;lines,
  199. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;width,
  200. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;prec,
  201. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;nfa)</code>
  202. <div class="block">Finds lines in the input image.</div>
  203. </td>
  204. </tr>
  205. <tr id="i7" class="rowColor">
  206. <td class="colFirst"><code>void</code></td>
  207. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/imgproc/LineSegmentDetector.html#drawSegments-org.opencv.core.Mat-org.opencv.core.Mat-">drawSegments</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image,
  208. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;lines)</code>
  209. <div class="block">Draws the line segments on a given image.</div>
  210. </td>
  211. </tr>
  212. </table>
  213. <ul class="blockList">
  214. <li class="blockList"><a name="methods.inherited.from.class.org.opencv.core.Algorithm">
  215. <!-- -->
  216. </a>
  217. <h3>Methods inherited from class&nbsp;org.opencv.core.<a href="../../../org/opencv/core/Algorithm.html" title="class in org.opencv.core">Algorithm</a></h3>
  218. <code><a href="../../../org/opencv/core/Algorithm.html#clear--">clear</a>, <a href="../../../org/opencv/core/Algorithm.html#empty--">empty</a>, <a href="../../../org/opencv/core/Algorithm.html#getDefaultName--">getDefaultName</a>, <a href="../../../org/opencv/core/Algorithm.html#getNativeObjAddr--">getNativeObjAddr</a>, <a href="../../../org/opencv/core/Algorithm.html#save-java.lang.String-">save</a></code></li>
  219. </ul>
  220. <ul class="blockList">
  221. <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
  222. <!-- -->
  223. </a>
  224. <h3>Methods inherited from class&nbsp;java.lang.Object</h3>
  225. <code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
  226. </ul>
  227. </li>
  228. </ul>
  229. </li>
  230. </ul>
  231. </div>
  232. <div class="details">
  233. <ul class="blockList">
  234. <li class="blockList">
  235. <!-- ============ METHOD DETAIL ========== -->
  236. <ul class="blockList">
  237. <li class="blockList"><a name="method.detail">
  238. <!-- -->
  239. </a>
  240. <h3>Method Detail</h3>
  241. <a name="Z:Z__fromPtr__-long-">
  242. <!-- -->
  243. </a>
  244. <ul class="blockList">
  245. <li class="blockList">
  246. <h4>__fromPtr__</h4>
  247. <pre>public static&nbsp;<a href="../../../org/opencv/imgproc/LineSegmentDetector.html" title="class in org.opencv.imgproc">LineSegmentDetector</a>&nbsp;__fromPtr__(long&nbsp;addr)</pre>
  248. </li>
  249. </ul>
  250. <a name="compareSegments-org.opencv.core.Size-org.opencv.core.Mat-org.opencv.core.Mat-">
  251. <!-- -->
  252. </a>
  253. <ul class="blockList">
  254. <li class="blockList">
  255. <h4>compareSegments</h4>
  256. <pre>public&nbsp;int&nbsp;compareSegments(<a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;size,
  257. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;lines1,
  258. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;lines2)</pre>
  259. <div class="block">Draws two groups of lines in blue and red, counting the non overlapping (mismatching) pixels.</div>
  260. <dl>
  261. <dt><span class="paramLabel">Parameters:</span></dt>
  262. <dd><code>size</code> - The size of the image, where lines1 and lines2 were found.</dd>
  263. <dd><code>lines1</code> - The first group of lines that needs to be drawn. It is visualized in blue color.</dd>
  264. <dd><code>lines2</code> - The second group of lines. They visualized in red color.
  265. in order for lines1 and lines2 to be drawn in the above mentioned colors.</dd>
  266. <dt><span class="returnLabel">Returns:</span></dt>
  267. <dd>automatically generated</dd>
  268. </dl>
  269. </li>
  270. </ul>
  271. <a name="compareSegments-org.opencv.core.Size-org.opencv.core.Mat-org.opencv.core.Mat-org.opencv.core.Mat-">
  272. <!-- -->
  273. </a>
  274. <ul class="blockList">
  275. <li class="blockList">
  276. <h4>compareSegments</h4>
  277. <pre>public&nbsp;int&nbsp;compareSegments(<a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;size,
  278. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;lines1,
  279. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;lines2,
  280. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image)</pre>
  281. <div class="block">Draws two groups of lines in blue and red, counting the non overlapping (mismatching) pixels.</div>
  282. <dl>
  283. <dt><span class="paramLabel">Parameters:</span></dt>
  284. <dd><code>size</code> - The size of the image, where lines1 and lines2 were found.</dd>
  285. <dd><code>lines1</code> - The first group of lines that needs to be drawn. It is visualized in blue color.</dd>
  286. <dd><code>lines2</code> - The second group of lines. They visualized in red color.</dd>
  287. <dd><code>image</code> - Optional image, where the lines will be drawn. The image should be color(3-channel)
  288. in order for lines1 and lines2 to be drawn in the above mentioned colors.</dd>
  289. <dt><span class="returnLabel">Returns:</span></dt>
  290. <dd>automatically generated</dd>
  291. </dl>
  292. </li>
  293. </ul>
  294. <a name="detect-org.opencv.core.Mat-org.opencv.core.Mat-">
  295. <!-- -->
  296. </a>
  297. <ul class="blockList">
  298. <li class="blockList">
  299. <h4>detect</h4>
  300. <pre>public&nbsp;void&nbsp;detect(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image,
  301. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;lines)</pre>
  302. <div class="block">Finds lines in the input image.
  303. This is the output of the default parameters of the algorithm on the above shown image.
  304. ![image](pics/building_lsd.png)</div>
  305. <dl>
  306. <dt><span class="paramLabel">Parameters:</span></dt>
  307. <dd><code>image</code> - A grayscale (CV_8UC1) input image. If only a roi needs to be selected, use:
  308. <code>lsd_ptr-&amp;gt;detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);</code></dd>
  309. <dd><code>lines</code> - A vector of Vec4f elements specifying the beginning and ending point of a line. Where
  310. Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 - end. Returned lines are strictly
  311. oriented depending on the gradient.
  312. bigger the value, logarithmically better the detection.
  313. <ul>
  314. <li>
  315. -1 corresponds to 10 mean false alarms
  316. </li>
  317. <li>
  318. 0 corresponds to 1 mean false alarm
  319. </li>
  320. <li>
  321. 1 corresponds to 0.1 mean false alarms
  322. This vector will be calculated only when the objects type is #LSD_REFINE_ADV.
  323. </li>
  324. </ul></dd>
  325. </dl>
  326. </li>
  327. </ul>
  328. <a name="detect-org.opencv.core.Mat-org.opencv.core.Mat-org.opencv.core.Mat-">
  329. <!-- -->
  330. </a>
  331. <ul class="blockList">
  332. <li class="blockList">
  333. <h4>detect</h4>
  334. <pre>public&nbsp;void&nbsp;detect(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image,
  335. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;lines,
  336. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;width)</pre>
  337. <div class="block">Finds lines in the input image.
  338. This is the output of the default parameters of the algorithm on the above shown image.
  339. ![image](pics/building_lsd.png)</div>
  340. <dl>
  341. <dt><span class="paramLabel">Parameters:</span></dt>
  342. <dd><code>image</code> - A grayscale (CV_8UC1) input image. If only a roi needs to be selected, use:
  343. <code>lsd_ptr-&amp;gt;detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);</code></dd>
  344. <dd><code>lines</code> - A vector of Vec4f elements specifying the beginning and ending point of a line. Where
  345. Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 - end. Returned lines are strictly
  346. oriented depending on the gradient.</dd>
  347. <dd><code>width</code> - Vector of widths of the regions, where the lines are found. E.g. Width of line.
  348. bigger the value, logarithmically better the detection.
  349. <ul>
  350. <li>
  351. -1 corresponds to 10 mean false alarms
  352. </li>
  353. <li>
  354. 0 corresponds to 1 mean false alarm
  355. </li>
  356. <li>
  357. 1 corresponds to 0.1 mean false alarms
  358. This vector will be calculated only when the objects type is #LSD_REFINE_ADV.
  359. </li>
  360. </ul></dd>
  361. </dl>
  362. </li>
  363. </ul>
  364. <a name="detect-org.opencv.core.Mat-org.opencv.core.Mat-org.opencv.core.Mat-org.opencv.core.Mat-">
  365. <!-- -->
  366. </a>
  367. <ul class="blockList">
  368. <li class="blockList">
  369. <h4>detect</h4>
  370. <pre>public&nbsp;void&nbsp;detect(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image,
  371. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;lines,
  372. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;width,
  373. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;prec)</pre>
  374. <div class="block">Finds lines in the input image.
  375. This is the output of the default parameters of the algorithm on the above shown image.
  376. ![image](pics/building_lsd.png)</div>
  377. <dl>
  378. <dt><span class="paramLabel">Parameters:</span></dt>
  379. <dd><code>image</code> - A grayscale (CV_8UC1) input image. If only a roi needs to be selected, use:
  380. <code>lsd_ptr-&amp;gt;detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);</code></dd>
  381. <dd><code>lines</code> - A vector of Vec4f elements specifying the beginning and ending point of a line. Where
  382. Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 - end. Returned lines are strictly
  383. oriented depending on the gradient.</dd>
  384. <dd><code>width</code> - Vector of widths of the regions, where the lines are found. E.g. Width of line.</dd>
  385. <dd><code>prec</code> - Vector of precisions with which the lines are found.
  386. bigger the value, logarithmically better the detection.
  387. <ul>
  388. <li>
  389. -1 corresponds to 10 mean false alarms
  390. </li>
  391. <li>
  392. 0 corresponds to 1 mean false alarm
  393. </li>
  394. <li>
  395. 1 corresponds to 0.1 mean false alarms
  396. This vector will be calculated only when the objects type is #LSD_REFINE_ADV.
  397. </li>
  398. </ul></dd>
  399. </dl>
  400. </li>
  401. </ul>
  402. <a name="detect-org.opencv.core.Mat-org.opencv.core.Mat-org.opencv.core.Mat-org.opencv.core.Mat-org.opencv.core.Mat-">
  403. <!-- -->
  404. </a>
  405. <ul class="blockList">
  406. <li class="blockList">
  407. <h4>detect</h4>
  408. <pre>public&nbsp;void&nbsp;detect(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image,
  409. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;lines,
  410. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;width,
  411. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;prec,
  412. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;nfa)</pre>
  413. <div class="block">Finds lines in the input image.
  414. This is the output of the default parameters of the algorithm on the above shown image.
  415. ![image](pics/building_lsd.png)</div>
  416. <dl>
  417. <dt><span class="paramLabel">Parameters:</span></dt>
  418. <dd><code>image</code> - A grayscale (CV_8UC1) input image. If only a roi needs to be selected, use:
  419. <code>lsd_ptr-&amp;gt;detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);</code></dd>
  420. <dd><code>lines</code> - A vector of Vec4f elements specifying the beginning and ending point of a line. Where
  421. Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 - end. Returned lines are strictly
  422. oriented depending on the gradient.</dd>
  423. <dd><code>width</code> - Vector of widths of the regions, where the lines are found. E.g. Width of line.</dd>
  424. <dd><code>prec</code> - Vector of precisions with which the lines are found.</dd>
  425. <dd><code>nfa</code> - Vector containing number of false alarms in the line region, with precision of 10%. The
  426. bigger the value, logarithmically better the detection.
  427. <ul>
  428. <li>
  429. -1 corresponds to 10 mean false alarms
  430. </li>
  431. <li>
  432. 0 corresponds to 1 mean false alarm
  433. </li>
  434. <li>
  435. 1 corresponds to 0.1 mean false alarms
  436. This vector will be calculated only when the objects type is #LSD_REFINE_ADV.
  437. </li>
  438. </ul></dd>
  439. </dl>
  440. </li>
  441. </ul>
  442. <a name="drawSegments-org.opencv.core.Mat-org.opencv.core.Mat-">
  443. <!-- -->
  444. </a>
  445. <ul class="blockListLast">
  446. <li class="blockList">
  447. <h4>drawSegments</h4>
  448. <pre>public&nbsp;void&nbsp;drawSegments(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image,
  449. <a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;lines)</pre>
  450. <div class="block">Draws the line segments on a given image.</div>
  451. <dl>
  452. <dt><span class="paramLabel">Parameters:</span></dt>
  453. <dd><code>image</code> - The image, where the lines will be drawn. Should be bigger or equal to the image,
  454. where the lines were found.</dd>
  455. <dd><code>lines</code> - A vector of the lines that needed to be drawn.</dd>
  456. </dl>
  457. </li>
  458. </ul>
  459. </li>
  460. </ul>
  461. </li>
  462. </ul>
  463. </div>
  464. </div>
  465. <!-- ========= END OF CLASS DATA ========= -->
  466. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  467. <div class="bottomNav"><a name="navbar.bottom">
  468. <!-- -->
  469. </a>
  470. <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
  471. <a name="navbar.bottom.firstrow">
  472. <!-- -->
  473. </a>
  474. <ul class="navList" title="Navigation">
  475. <li><a href="../../../overview-summary.html">Overview</a></li>
  476. <li><a href="package-summary.html">Package</a></li>
  477. <li class="navBarCell1Rev">Class</li>
  478. <li><a href="package-tree.html">Tree</a></li>
  479. <li><a href="../../../index-all.html">Index</a></li>
  480. <li><a href="../../../help-doc.html">Help</a></li>
  481. </ul>
  482. <div class="aboutLanguage">
  483. <script>
  484. var url = window.location.href;
  485. var pos = url.lastIndexOf('/javadoc/');
  486. url = pos >= 0 ? (url.substring(0, pos) + '/javadoc/mymath.js') : (window.location.origin + '/mymath.js');
  487. var script = document.createElement('script');
  488. script.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML,' + url;
  489. document.getElementsByTagName('head')[0].appendChild(script);
  490. </script>
  491. </div>
  492. </div>
  493. <div class="subNav">
  494. <ul class="navList">
  495. <li><a href="../../../org/opencv/imgproc/IntelligentScissorsMB.html" title="class in org.opencv.imgproc"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  496. <li><a href="../../../org/opencv/imgproc/Moments.html" title="class in org.opencv.imgproc"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  497. </ul>
  498. <ul class="navList">
  499. <li><a href="../../../index.html?org/opencv/imgproc/LineSegmentDetector.html" target="_top">Frames</a></li>
  500. <li><a href="LineSegmentDetector.html" target="_top">No&nbsp;Frames</a></li>
  501. </ul>
  502. <ul class="navList" id="allclasses_navbar_bottom">
  503. <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  504. </ul>
  505. <div>
  506. <script type="text/javascript"><!--
  507. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  508. if(window==top) {
  509. allClassesLink.style.display = "block";
  510. }
  511. else {
  512. allClassesLink.style.display = "none";
  513. }
  514. //-->
  515. </script>
  516. </div>
  517. <div>
  518. <ul class="subNavList">
  519. <li>Summary:&nbsp;</li>
  520. <li>Nested&nbsp;|&nbsp;</li>
  521. <li>Field&nbsp;|&nbsp;</li>
  522. <li>Constr&nbsp;|&nbsp;</li>
  523. <li><a href="#method.summary">Method</a></li>
  524. </ul>
  525. <ul class="subNavList">
  526. <li>Detail:&nbsp;</li>
  527. <li>Field&nbsp;|&nbsp;</li>
  528. <li>Constr&nbsp;|&nbsp;</li>
  529. <li><a href="#method.detail">Method</a></li>
  530. </ul>
  531. </div>
  532. <a name="skip.navbar.bottom">
  533. <!-- -->
  534. </a></div>
  535. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  536. <p class="legalCopy"><small>Generated on 2023-06-28 12:47:21 / OpenCV 4.8.0</small></p>
  537. </body>
  538. </html>