BackgroundSubtractorKNN.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  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:23 UTC 2023 -->
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. <title>BackgroundSubtractorKNN (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="BackgroundSubtractorKNN (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,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":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/video/BackgroundSubtractor.html" title="class in org.opencv.video"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  62. <li><a href="../../../org/opencv/video/BackgroundSubtractorMOG2.html" title="class in org.opencv.video"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  63. </ul>
  64. <ul class="navList">
  65. <li><a href="../../../index.html?org/opencv/video/BackgroundSubtractorKNN.html" target="_top">Frames</a></li>
  66. <li><a href="BackgroundSubtractorKNN.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.video</div>
  105. <h2 title="Class BackgroundSubtractorKNN" class="title">Class BackgroundSubtractorKNN</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><a href="../../../org/opencv/video/BackgroundSubtractor.html" title="class in org.opencv.video">org.opencv.video.BackgroundSubtractor</a></li>
  116. <li>
  117. <ul class="inheritance">
  118. <li>org.opencv.video.BackgroundSubtractorKNN</li>
  119. </ul>
  120. </li>
  121. </ul>
  122. </li>
  123. </ul>
  124. </li>
  125. </ul>
  126. <div class="description">
  127. <ul class="blockList">
  128. <li class="blockList">
  129. <hr>
  130. <br>
  131. <pre>public class <span class="typeNameLabel">BackgroundSubtractorKNN</span>
  132. extends <a href="../../../org/opencv/video/BackgroundSubtractor.html" title="class in org.opencv.video">BackgroundSubtractor</a></pre>
  133. <div class="block">K-nearest neighbours - based Background/Foreground Segmentation Algorithm.
  134. The class implements the K-nearest neighbours background subtraction described in CITE: Zivkovic2006 .
  135. Very efficient if number of foreground pixels is low.</div>
  136. </li>
  137. </ul>
  138. </div>
  139. <div class="summary">
  140. <ul class="blockList">
  141. <li class="blockList">
  142. <!-- ========== METHOD SUMMARY =========== -->
  143. <ul class="blockList">
  144. <li class="blockList"><a name="method.summary">
  145. <!-- -->
  146. </a>
  147. <h3>Method Summary</h3>
  148. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  149. <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>
  150. <tr>
  151. <th class="colFirst" scope="col">Modifier and Type</th>
  152. <th class="colLast" scope="col">Method and Description</th>
  153. </tr>
  154. <tr id="i0" class="altColor">
  155. <td class="colFirst"><code>static <a href="../../../org/opencv/video/BackgroundSubtractorKNN.html" title="class in org.opencv.video">BackgroundSubtractorKNN</a></code></td>
  156. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/video/BackgroundSubtractorKNN.html#Z:Z__fromPtr__-long-">__fromPtr__</a></span>(long&nbsp;addr)</code>&nbsp;</td>
  157. </tr>
  158. <tr id="i1" class="rowColor">
  159. <td class="colFirst"><code>boolean</code></td>
  160. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/video/BackgroundSubtractorKNN.html#getDetectShadows--">getDetectShadows</a></span>()</code>
  161. <div class="block">Returns the shadow detection flag
  162. If true, the algorithm detects shadows and marks them.</div>
  163. </td>
  164. </tr>
  165. <tr id="i2" class="altColor">
  166. <td class="colFirst"><code>double</code></td>
  167. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/video/BackgroundSubtractorKNN.html#getDist2Threshold--">getDist2Threshold</a></span>()</code>
  168. <div class="block">Returns the threshold on the squared distance between the pixel and the sample
  169. The threshold on the squared distance between the pixel and the sample to decide whether a pixel is
  170. close to a data sample.</div>
  171. </td>
  172. </tr>
  173. <tr id="i3" class="rowColor">
  174. <td class="colFirst"><code>int</code></td>
  175. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/video/BackgroundSubtractorKNN.html#getHistory--">getHistory</a></span>()</code>
  176. <div class="block">Returns the number of last frames that affect the background model</div>
  177. </td>
  178. </tr>
  179. <tr id="i4" class="altColor">
  180. <td class="colFirst"><code>int</code></td>
  181. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/video/BackgroundSubtractorKNN.html#getkNNSamples--">getkNNSamples</a></span>()</code>
  182. <div class="block">Returns the number of neighbours, the k in the kNN.</div>
  183. </td>
  184. </tr>
  185. <tr id="i5" class="rowColor">
  186. <td class="colFirst"><code>int</code></td>
  187. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/video/BackgroundSubtractorKNN.html#getNSamples--">getNSamples</a></span>()</code>
  188. <div class="block">Returns the number of data samples in the background model</div>
  189. </td>
  190. </tr>
  191. <tr id="i6" class="altColor">
  192. <td class="colFirst"><code>double</code></td>
  193. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/video/BackgroundSubtractorKNN.html#getShadowThreshold--">getShadowThreshold</a></span>()</code>
  194. <div class="block">Returns the shadow threshold
  195. A shadow is detected if pixel is a darker version of the background.</div>
  196. </td>
  197. </tr>
  198. <tr id="i7" class="rowColor">
  199. <td class="colFirst"><code>int</code></td>
  200. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/video/BackgroundSubtractorKNN.html#getShadowValue--">getShadowValue</a></span>()</code>
  201. <div class="block">Returns the shadow value
  202. Shadow value is the value used to mark shadows in the foreground mask.</div>
  203. </td>
  204. </tr>
  205. <tr id="i8" class="altColor">
  206. <td class="colFirst"><code>void</code></td>
  207. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/video/BackgroundSubtractorKNN.html#setDetectShadows-boolean-">setDetectShadows</a></span>(boolean&nbsp;detectShadows)</code>
  208. <div class="block">Enables or disables shadow detection</div>
  209. </td>
  210. </tr>
  211. <tr id="i9" class="rowColor">
  212. <td class="colFirst"><code>void</code></td>
  213. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/video/BackgroundSubtractorKNN.html#setDist2Threshold-double-">setDist2Threshold</a></span>(double&nbsp;_dist2Threshold)</code>
  214. <div class="block">Sets the threshold on the squared distance</div>
  215. </td>
  216. </tr>
  217. <tr id="i10" class="altColor">
  218. <td class="colFirst"><code>void</code></td>
  219. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/video/BackgroundSubtractorKNN.html#setHistory-int-">setHistory</a></span>(int&nbsp;history)</code>
  220. <div class="block">Sets the number of last frames that affect the background model</div>
  221. </td>
  222. </tr>
  223. <tr id="i11" class="rowColor">
  224. <td class="colFirst"><code>void</code></td>
  225. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/video/BackgroundSubtractorKNN.html#setkNNSamples-int-">setkNNSamples</a></span>(int&nbsp;_nkNN)</code>
  226. <div class="block">Sets the k in the kNN.</div>
  227. </td>
  228. </tr>
  229. <tr id="i12" class="altColor">
  230. <td class="colFirst"><code>void</code></td>
  231. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/video/BackgroundSubtractorKNN.html#setNSamples-int-">setNSamples</a></span>(int&nbsp;_nN)</code>
  232. <div class="block">Sets the number of data samples in the background model.</div>
  233. </td>
  234. </tr>
  235. <tr id="i13" class="rowColor">
  236. <td class="colFirst"><code>void</code></td>
  237. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/video/BackgroundSubtractorKNN.html#setShadowThreshold-double-">setShadowThreshold</a></span>(double&nbsp;threshold)</code>
  238. <div class="block">Sets the shadow threshold</div>
  239. </td>
  240. </tr>
  241. <tr id="i14" class="altColor">
  242. <td class="colFirst"><code>void</code></td>
  243. <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/video/BackgroundSubtractorKNN.html#setShadowValue-int-">setShadowValue</a></span>(int&nbsp;value)</code>
  244. <div class="block">Sets the shadow value</div>
  245. </td>
  246. </tr>
  247. </table>
  248. <ul class="blockList">
  249. <li class="blockList"><a name="methods.inherited.from.class.org.opencv.video.BackgroundSubtractor">
  250. <!-- -->
  251. </a>
  252. <h3>Methods inherited from class&nbsp;org.opencv.video.<a href="../../../org/opencv/video/BackgroundSubtractor.html" title="class in org.opencv.video">BackgroundSubtractor</a></h3>
  253. <code><a href="../../../org/opencv/video/BackgroundSubtractor.html#apply-org.opencv.core.Mat-org.opencv.core.Mat-">apply</a>, <a href="../../../org/opencv/video/BackgroundSubtractor.html#apply-org.opencv.core.Mat-org.opencv.core.Mat-double-">apply</a>, <a href="../../../org/opencv/video/BackgroundSubtractor.html#getBackgroundImage-org.opencv.core.Mat-">getBackgroundImage</a></code></li>
  254. </ul>
  255. <ul class="blockList">
  256. <li class="blockList"><a name="methods.inherited.from.class.org.opencv.core.Algorithm">
  257. <!-- -->
  258. </a>
  259. <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>
  260. <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>
  261. </ul>
  262. <ul class="blockList">
  263. <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
  264. <!-- -->
  265. </a>
  266. <h3>Methods inherited from class&nbsp;java.lang.Object</h3>
  267. <code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
  268. </ul>
  269. </li>
  270. </ul>
  271. </li>
  272. </ul>
  273. </div>
  274. <div class="details">
  275. <ul class="blockList">
  276. <li class="blockList">
  277. <!-- ============ METHOD DETAIL ========== -->
  278. <ul class="blockList">
  279. <li class="blockList"><a name="method.detail">
  280. <!-- -->
  281. </a>
  282. <h3>Method Detail</h3>
  283. <a name="Z:Z__fromPtr__-long-">
  284. <!-- -->
  285. </a>
  286. <ul class="blockList">
  287. <li class="blockList">
  288. <h4>__fromPtr__</h4>
  289. <pre>public static&nbsp;<a href="../../../org/opencv/video/BackgroundSubtractorKNN.html" title="class in org.opencv.video">BackgroundSubtractorKNN</a>&nbsp;__fromPtr__(long&nbsp;addr)</pre>
  290. </li>
  291. </ul>
  292. <a name="getDetectShadows--">
  293. <!-- -->
  294. </a>
  295. <ul class="blockList">
  296. <li class="blockList">
  297. <h4>getDetectShadows</h4>
  298. <pre>public&nbsp;boolean&nbsp;getDetectShadows()</pre>
  299. <div class="block">Returns the shadow detection flag
  300. If true, the algorithm detects shadows and marks them. See createBackgroundSubtractorKNN for
  301. details.</div>
  302. <dl>
  303. <dt><span class="returnLabel">Returns:</span></dt>
  304. <dd>automatically generated</dd>
  305. </dl>
  306. </li>
  307. </ul>
  308. <a name="getDist2Threshold--">
  309. <!-- -->
  310. </a>
  311. <ul class="blockList">
  312. <li class="blockList">
  313. <h4>getDist2Threshold</h4>
  314. <pre>public&nbsp;double&nbsp;getDist2Threshold()</pre>
  315. <div class="block">Returns the threshold on the squared distance between the pixel and the sample
  316. The threshold on the squared distance between the pixel and the sample to decide whether a pixel is
  317. close to a data sample.</div>
  318. <dl>
  319. <dt><span class="returnLabel">Returns:</span></dt>
  320. <dd>automatically generated</dd>
  321. </dl>
  322. </li>
  323. </ul>
  324. <a name="getHistory--">
  325. <!-- -->
  326. </a>
  327. <ul class="blockList">
  328. <li class="blockList">
  329. <h4>getHistory</h4>
  330. <pre>public&nbsp;int&nbsp;getHistory()</pre>
  331. <div class="block">Returns the number of last frames that affect the background model</div>
  332. <dl>
  333. <dt><span class="returnLabel">Returns:</span></dt>
  334. <dd>automatically generated</dd>
  335. </dl>
  336. </li>
  337. </ul>
  338. <a name="getkNNSamples--">
  339. <!-- -->
  340. </a>
  341. <ul class="blockList">
  342. <li class="blockList">
  343. <h4>getkNNSamples</h4>
  344. <pre>public&nbsp;int&nbsp;getkNNSamples()</pre>
  345. <div class="block">Returns the number of neighbours, the k in the kNN.
  346. K is the number of samples that need to be within dist2Threshold in order to decide that that
  347. pixel is matching the kNN background model.</div>
  348. <dl>
  349. <dt><span class="returnLabel">Returns:</span></dt>
  350. <dd>automatically generated</dd>
  351. </dl>
  352. </li>
  353. </ul>
  354. <a name="getNSamples--">
  355. <!-- -->
  356. </a>
  357. <ul class="blockList">
  358. <li class="blockList">
  359. <h4>getNSamples</h4>
  360. <pre>public&nbsp;int&nbsp;getNSamples()</pre>
  361. <div class="block">Returns the number of data samples in the background model</div>
  362. <dl>
  363. <dt><span class="returnLabel">Returns:</span></dt>
  364. <dd>automatically generated</dd>
  365. </dl>
  366. </li>
  367. </ul>
  368. <a name="getShadowThreshold--">
  369. <!-- -->
  370. </a>
  371. <ul class="blockList">
  372. <li class="blockList">
  373. <h4>getShadowThreshold</h4>
  374. <pre>public&nbsp;double&nbsp;getShadowThreshold()</pre>
  375. <div class="block">Returns the shadow threshold
  376. A shadow is detected if pixel is a darker version of the background. The shadow threshold (Tau in
  377. the paper) is a threshold defining how much darker the shadow can be. Tau= 0.5 means that if a pixel
  378. is more than twice darker then it is not shadow. See Prati, Mikic, Trivedi and Cucchiara,
  379. Detecting Moving Shadows...*, IEEE PAMI,2003.</div>
  380. <dl>
  381. <dt><span class="returnLabel">Returns:</span></dt>
  382. <dd>automatically generated</dd>
  383. </dl>
  384. </li>
  385. </ul>
  386. <a name="getShadowValue--">
  387. <!-- -->
  388. </a>
  389. <ul class="blockList">
  390. <li class="blockList">
  391. <h4>getShadowValue</h4>
  392. <pre>public&nbsp;int&nbsp;getShadowValue()</pre>
  393. <div class="block">Returns the shadow value
  394. Shadow value is the value used to mark shadows in the foreground mask. Default value is 127. Value 0
  395. in the mask always means background, 255 means foreground.</div>
  396. <dl>
  397. <dt><span class="returnLabel">Returns:</span></dt>
  398. <dd>automatically generated</dd>
  399. </dl>
  400. </li>
  401. </ul>
  402. <a name="setDetectShadows-boolean-">
  403. <!-- -->
  404. </a>
  405. <ul class="blockList">
  406. <li class="blockList">
  407. <h4>setDetectShadows</h4>
  408. <pre>public&nbsp;void&nbsp;setDetectShadows(boolean&nbsp;detectShadows)</pre>
  409. <div class="block">Enables or disables shadow detection</div>
  410. <dl>
  411. <dt><span class="paramLabel">Parameters:</span></dt>
  412. <dd><code>detectShadows</code> - automatically generated</dd>
  413. </dl>
  414. </li>
  415. </ul>
  416. <a name="setDist2Threshold-double-">
  417. <!-- -->
  418. </a>
  419. <ul class="blockList">
  420. <li class="blockList">
  421. <h4>setDist2Threshold</h4>
  422. <pre>public&nbsp;void&nbsp;setDist2Threshold(double&nbsp;_dist2Threshold)</pre>
  423. <div class="block">Sets the threshold on the squared distance</div>
  424. <dl>
  425. <dt><span class="paramLabel">Parameters:</span></dt>
  426. <dd><code>_dist2Threshold</code> - automatically generated</dd>
  427. </dl>
  428. </li>
  429. </ul>
  430. <a name="setHistory-int-">
  431. <!-- -->
  432. </a>
  433. <ul class="blockList">
  434. <li class="blockList">
  435. <h4>setHistory</h4>
  436. <pre>public&nbsp;void&nbsp;setHistory(int&nbsp;history)</pre>
  437. <div class="block">Sets the number of last frames that affect the background model</div>
  438. <dl>
  439. <dt><span class="paramLabel">Parameters:</span></dt>
  440. <dd><code>history</code> - automatically generated</dd>
  441. </dl>
  442. </li>
  443. </ul>
  444. <a name="setkNNSamples-int-">
  445. <!-- -->
  446. </a>
  447. <ul class="blockList">
  448. <li class="blockList">
  449. <h4>setkNNSamples</h4>
  450. <pre>public&nbsp;void&nbsp;setkNNSamples(int&nbsp;_nkNN)</pre>
  451. <div class="block">Sets the k in the kNN. How many nearest neighbours need to match.</div>
  452. <dl>
  453. <dt><span class="paramLabel">Parameters:</span></dt>
  454. <dd><code>_nkNN</code> - automatically generated</dd>
  455. </dl>
  456. </li>
  457. </ul>
  458. <a name="setNSamples-int-">
  459. <!-- -->
  460. </a>
  461. <ul class="blockList">
  462. <li class="blockList">
  463. <h4>setNSamples</h4>
  464. <pre>public&nbsp;void&nbsp;setNSamples(int&nbsp;_nN)</pre>
  465. <div class="block">Sets the number of data samples in the background model.
  466. The model needs to be reinitalized to reserve memory.</div>
  467. <dl>
  468. <dt><span class="paramLabel">Parameters:</span></dt>
  469. <dd><code>_nN</code> - automatically generated</dd>
  470. </dl>
  471. </li>
  472. </ul>
  473. <a name="setShadowThreshold-double-">
  474. <!-- -->
  475. </a>
  476. <ul class="blockList">
  477. <li class="blockList">
  478. <h4>setShadowThreshold</h4>
  479. <pre>public&nbsp;void&nbsp;setShadowThreshold(double&nbsp;threshold)</pre>
  480. <div class="block">Sets the shadow threshold</div>
  481. <dl>
  482. <dt><span class="paramLabel">Parameters:</span></dt>
  483. <dd><code>threshold</code> - automatically generated</dd>
  484. </dl>
  485. </li>
  486. </ul>
  487. <a name="setShadowValue-int-">
  488. <!-- -->
  489. </a>
  490. <ul class="blockListLast">
  491. <li class="blockList">
  492. <h4>setShadowValue</h4>
  493. <pre>public&nbsp;void&nbsp;setShadowValue(int&nbsp;value)</pre>
  494. <div class="block">Sets the shadow value</div>
  495. <dl>
  496. <dt><span class="paramLabel">Parameters:</span></dt>
  497. <dd><code>value</code> - automatically generated</dd>
  498. </dl>
  499. </li>
  500. </ul>
  501. </li>
  502. </ul>
  503. </li>
  504. </ul>
  505. </div>
  506. </div>
  507. <!-- ========= END OF CLASS DATA ========= -->
  508. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  509. <div class="bottomNav"><a name="navbar.bottom">
  510. <!-- -->
  511. </a>
  512. <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
  513. <a name="navbar.bottom.firstrow">
  514. <!-- -->
  515. </a>
  516. <ul class="navList" title="Navigation">
  517. <li><a href="../../../overview-summary.html">Overview</a></li>
  518. <li><a href="package-summary.html">Package</a></li>
  519. <li class="navBarCell1Rev">Class</li>
  520. <li><a href="package-tree.html">Tree</a></li>
  521. <li><a href="../../../index-all.html">Index</a></li>
  522. <li><a href="../../../help-doc.html">Help</a></li>
  523. </ul>
  524. <div class="aboutLanguage">
  525. <script>
  526. var url = window.location.href;
  527. var pos = url.lastIndexOf('/javadoc/');
  528. url = pos >= 0 ? (url.substring(0, pos) + '/javadoc/mymath.js') : (window.location.origin + '/mymath.js');
  529. var script = document.createElement('script');
  530. script.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML,' + url;
  531. document.getElementsByTagName('head')[0].appendChild(script);
  532. </script>
  533. </div>
  534. </div>
  535. <div class="subNav">
  536. <ul class="navList">
  537. <li><a href="../../../org/opencv/video/BackgroundSubtractor.html" title="class in org.opencv.video"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  538. <li><a href="../../../org/opencv/video/BackgroundSubtractorMOG2.html" title="class in org.opencv.video"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  539. </ul>
  540. <ul class="navList">
  541. <li><a href="../../../index.html?org/opencv/video/BackgroundSubtractorKNN.html" target="_top">Frames</a></li>
  542. <li><a href="BackgroundSubtractorKNN.html" target="_top">No&nbsp;Frames</a></li>
  543. </ul>
  544. <ul class="navList" id="allclasses_navbar_bottom">
  545. <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  546. </ul>
  547. <div>
  548. <script type="text/javascript"><!--
  549. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  550. if(window==top) {
  551. allClassesLink.style.display = "block";
  552. }
  553. else {
  554. allClassesLink.style.display = "none";
  555. }
  556. //-->
  557. </script>
  558. </div>
  559. <div>
  560. <ul class="subNavList">
  561. <li>Summary:&nbsp;</li>
  562. <li>Nested&nbsp;|&nbsp;</li>
  563. <li>Field&nbsp;|&nbsp;</li>
  564. <li>Constr&nbsp;|&nbsp;</li>
  565. <li><a href="#method.summary">Method</a></li>
  566. </ul>
  567. <ul class="subNavList">
  568. <li>Detail:&nbsp;</li>
  569. <li>Field&nbsp;|&nbsp;</li>
  570. <li>Constr&nbsp;|&nbsp;</li>
  571. <li><a href="#method.detail">Method</a></li>
  572. </ul>
  573. </div>
  574. <a name="skip.navbar.bottom">
  575. <!-- -->
  576. </a></div>
  577. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  578. <p class="legalCopy"><small>Generated on 2023-06-28 12:47:21 / OpenCV 4.8.0</small></p>
  579. </body>
  580. </html>