StereoSGBM.h 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  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/calib3d.hpp"
  8. #else
  9. #define CV_EXPORTS
  10. #endif
  11. #import <Foundation/Foundation.h>
  12. #import "StereoMatcher.h"
  13. NS_ASSUME_NONNULL_BEGIN
  14. // C++: class StereoSGBM
  15. /**
  16. * The class implements the modified H. Hirschmuller algorithm CITE: HH08 that differs from the original
  17. * one as follows:
  18. *
  19. * - By default, the algorithm is single-pass, which means that you consider only 5 directions
  20. * instead of 8. Set mode=StereoSGBM::MODE_HH in createStereoSGBM to run the full variant of the
  21. * algorithm but beware that it may consume a lot of memory.
  22. * - The algorithm matches blocks, not individual pixels. Though, setting blockSize=1 reduces the
  23. * blocks to single pixels.
  24. * - Mutual information cost function is not implemented. Instead, a simpler Birchfield-Tomasi
  25. * sub-pixel metric from CITE: BT98 is used. Though, the color images are supported as well.
  26. * - Some pre- and post- processing steps from K. Konolige algorithm StereoBM are included, for
  27. * example: pre-filtering (StereoBM::PREFILTER_XSOBEL type) and post-filtering (uniqueness
  28. * check, quadratic interpolation and speckle filtering).
  29. *
  30. * NOTE:
  31. * - (Python) An example illustrating the use of the StereoSGBM matching algorithm can be found
  32. * at opencv_source_code/samples/python/stereo_match.py
  33. *
  34. * Member of `Calib3d`
  35. */
  36. CV_EXPORTS @interface StereoSGBM : StereoMatcher
  37. #ifdef __cplusplus
  38. @property(readonly)cv::Ptr<cv::StereoSGBM> nativePtrStereoSGBM;
  39. #endif
  40. #ifdef __cplusplus
  41. - (instancetype)initWithNativePtr:(cv::Ptr<cv::StereoSGBM>)nativePtr;
  42. + (instancetype)fromNative:(cv::Ptr<cv::StereoSGBM>)nativePtr;
  43. #endif
  44. #pragma mark - Class Constants
  45. @property (class, readonly) int MODE_SGBM NS_SWIFT_NAME(MODE_SGBM);
  46. @property (class, readonly) int MODE_HH NS_SWIFT_NAME(MODE_HH);
  47. @property (class, readonly) int MODE_SGBM_3WAY NS_SWIFT_NAME(MODE_SGBM_3WAY);
  48. @property (class, readonly) int MODE_HH4 NS_SWIFT_NAME(MODE_HH4);
  49. #pragma mark - Methods
  50. //
  51. // int cv::StereoSGBM::getPreFilterCap()
  52. //
  53. - (int)getPreFilterCap NS_SWIFT_NAME(getPreFilterCap());
  54. //
  55. // void cv::StereoSGBM::setPreFilterCap(int preFilterCap)
  56. //
  57. - (void)setPreFilterCap:(int)preFilterCap NS_SWIFT_NAME(setPreFilterCap(preFilterCap:));
  58. //
  59. // int cv::StereoSGBM::getUniquenessRatio()
  60. //
  61. - (int)getUniquenessRatio NS_SWIFT_NAME(getUniquenessRatio());
  62. //
  63. // void cv::StereoSGBM::setUniquenessRatio(int uniquenessRatio)
  64. //
  65. - (void)setUniquenessRatio:(int)uniquenessRatio NS_SWIFT_NAME(setUniquenessRatio(uniquenessRatio:));
  66. //
  67. // int cv::StereoSGBM::getP1()
  68. //
  69. - (int)getP1 NS_SWIFT_NAME(getP1());
  70. //
  71. // void cv::StereoSGBM::setP1(int P1)
  72. //
  73. - (void)setP1:(int)P1 NS_SWIFT_NAME(setP1(P1:));
  74. //
  75. // int cv::StereoSGBM::getP2()
  76. //
  77. - (int)getP2 NS_SWIFT_NAME(getP2());
  78. //
  79. // void cv::StereoSGBM::setP2(int P2)
  80. //
  81. - (void)setP2:(int)P2 NS_SWIFT_NAME(setP2(P2:));
  82. //
  83. // int cv::StereoSGBM::getMode()
  84. //
  85. - (int)getMode NS_SWIFT_NAME(getMode());
  86. //
  87. // void cv::StereoSGBM::setMode(int mode)
  88. //
  89. - (void)setMode:(int)mode NS_SWIFT_NAME(setMode(mode:));
  90. //
  91. // static Ptr_StereoSGBM cv::StereoSGBM::create(int minDisparity = 0, int numDisparities = 16, int blockSize = 3, int P1 = 0, int P2 = 0, int disp12MaxDiff = 0, int preFilterCap = 0, int uniquenessRatio = 0, int speckleWindowSize = 0, int speckleRange = 0, int mode = StereoSGBM::MODE_SGBM)
  92. //
  93. /**
  94. * Creates StereoSGBM object
  95. *
  96. * @param minDisparity Minimum possible disparity value. Normally, it is zero but sometimes
  97. * rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
  98. * @param numDisparities Maximum disparity minus minimum disparity. The value is always greater than
  99. * zero. In the current implementation, this parameter must be divisible by 16.
  100. * @param blockSize Matched block size. It must be an odd number \>=1 . Normally, it should be
  101. * somewhere in the 3..11 range.
  102. * @param P1 The first parameter controlling the disparity smoothness. See below.
  103. * @param P2 The second parameter controlling the disparity smoothness. The larger the values are,
  104. * the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1
  105. * between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor
  106. * pixels. The algorithm requires P2 \> P1 . See stereo_match.cpp sample where some reasonably good
  107. * P1 and P2 values are shown (like 8\*number_of_image_channels\*blockSize\*blockSize and
  108. * 32\*number_of_image_channels\*blockSize\*blockSize , respectively).
  109. * @param disp12MaxDiff Maximum allowed difference (in integer pixel units) in the left-right
  110. * disparity check. Set it to a non-positive value to disable the check.
  111. * @param preFilterCap Truncation value for the prefiltered image pixels. The algorithm first
  112. * computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval.
  113. * The result values are passed to the Birchfield-Tomasi pixel cost function.
  114. * @param uniquenessRatio Margin in percentage by which the best (minimum) computed cost function
  115. * value should "win" the second best value to consider the found match correct. Normally, a value
  116. * within the 5-15 range is good enough.
  117. * @param speckleWindowSize Maximum size of smooth disparity regions to consider their noise speckles
  118. * and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the
  119. * 50-200 range.
  120. * @param speckleRange Maximum disparity variation within each connected component. If you do speckle
  121. * filtering, set the parameter to a positive value, it will be implicitly multiplied by 16.
  122. * Normally, 1 or 2 is good enough.
  123. * @param mode Set it to StereoSGBM::MODE_HH to run the full-scale two-pass dynamic programming
  124. * algorithm. It will consume O(W\*H\*numDisparities) bytes, which is large for 640x480 stereo and
  125. * huge for HD-size pictures. By default, it is set to false .
  126. *
  127. * The first constructor initializes StereoSGBM with all the default parameters. So, you only have to
  128. * set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter
  129. * to a custom value.
  130. */
  131. + (StereoSGBM*)create:(int)minDisparity numDisparities:(int)numDisparities blockSize:(int)blockSize P1:(int)P1 P2:(int)P2 disp12MaxDiff:(int)disp12MaxDiff preFilterCap:(int)preFilterCap uniquenessRatio:(int)uniquenessRatio speckleWindowSize:(int)speckleWindowSize speckleRange:(int)speckleRange mode:(int)mode NS_SWIFT_NAME(create(minDisparity:numDisparities:blockSize:P1:P2:disp12MaxDiff:preFilterCap:uniquenessRatio:speckleWindowSize:speckleRange:mode:));
  132. /**
  133. * Creates StereoSGBM object
  134. *
  135. * @param minDisparity Minimum possible disparity value. Normally, it is zero but sometimes
  136. * rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
  137. * @param numDisparities Maximum disparity minus minimum disparity. The value is always greater than
  138. * zero. In the current implementation, this parameter must be divisible by 16.
  139. * @param blockSize Matched block size. It must be an odd number \>=1 . Normally, it should be
  140. * somewhere in the 3..11 range.
  141. * @param P1 The first parameter controlling the disparity smoothness. See below.
  142. * @param P2 The second parameter controlling the disparity smoothness. The larger the values are,
  143. * the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1
  144. * between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor
  145. * pixels. The algorithm requires P2 \> P1 . See stereo_match.cpp sample where some reasonably good
  146. * P1 and P2 values are shown (like 8\*number_of_image_channels\*blockSize\*blockSize and
  147. * 32\*number_of_image_channels\*blockSize\*blockSize , respectively).
  148. * @param disp12MaxDiff Maximum allowed difference (in integer pixel units) in the left-right
  149. * disparity check. Set it to a non-positive value to disable the check.
  150. * @param preFilterCap Truncation value for the prefiltered image pixels. The algorithm first
  151. * computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval.
  152. * The result values are passed to the Birchfield-Tomasi pixel cost function.
  153. * @param uniquenessRatio Margin in percentage by which the best (minimum) computed cost function
  154. * value should "win" the second best value to consider the found match correct. Normally, a value
  155. * within the 5-15 range is good enough.
  156. * @param speckleWindowSize Maximum size of smooth disparity regions to consider their noise speckles
  157. * and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the
  158. * 50-200 range.
  159. * @param speckleRange Maximum disparity variation within each connected component. If you do speckle
  160. * filtering, set the parameter to a positive value, it will be implicitly multiplied by 16.
  161. * Normally, 1 or 2 is good enough.
  162. * algorithm. It will consume O(W\*H\*numDisparities) bytes, which is large for 640x480 stereo and
  163. * huge for HD-size pictures. By default, it is set to false .
  164. *
  165. * The first constructor initializes StereoSGBM with all the default parameters. So, you only have to
  166. * set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter
  167. * to a custom value.
  168. */
  169. + (StereoSGBM*)create:(int)minDisparity numDisparities:(int)numDisparities blockSize:(int)blockSize P1:(int)P1 P2:(int)P2 disp12MaxDiff:(int)disp12MaxDiff preFilterCap:(int)preFilterCap uniquenessRatio:(int)uniquenessRatio speckleWindowSize:(int)speckleWindowSize speckleRange:(int)speckleRange NS_SWIFT_NAME(create(minDisparity:numDisparities:blockSize:P1:P2:disp12MaxDiff:preFilterCap:uniquenessRatio:speckleWindowSize:speckleRange:));
  170. /**
  171. * Creates StereoSGBM object
  172. *
  173. * @param minDisparity Minimum possible disparity value. Normally, it is zero but sometimes
  174. * rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
  175. * @param numDisparities Maximum disparity minus minimum disparity. The value is always greater than
  176. * zero. In the current implementation, this parameter must be divisible by 16.
  177. * @param blockSize Matched block size. It must be an odd number \>=1 . Normally, it should be
  178. * somewhere in the 3..11 range.
  179. * @param P1 The first parameter controlling the disparity smoothness. See below.
  180. * @param P2 The second parameter controlling the disparity smoothness. The larger the values are,
  181. * the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1
  182. * between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor
  183. * pixels. The algorithm requires P2 \> P1 . See stereo_match.cpp sample where some reasonably good
  184. * P1 and P2 values are shown (like 8\*number_of_image_channels\*blockSize\*blockSize and
  185. * 32\*number_of_image_channels\*blockSize\*blockSize , respectively).
  186. * @param disp12MaxDiff Maximum allowed difference (in integer pixel units) in the left-right
  187. * disparity check. Set it to a non-positive value to disable the check.
  188. * @param preFilterCap Truncation value for the prefiltered image pixels. The algorithm first
  189. * computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval.
  190. * The result values are passed to the Birchfield-Tomasi pixel cost function.
  191. * @param uniquenessRatio Margin in percentage by which the best (minimum) computed cost function
  192. * value should "win" the second best value to consider the found match correct. Normally, a value
  193. * within the 5-15 range is good enough.
  194. * @param speckleWindowSize Maximum size of smooth disparity regions to consider their noise speckles
  195. * and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the
  196. * 50-200 range.
  197. * filtering, set the parameter to a positive value, it will be implicitly multiplied by 16.
  198. * Normally, 1 or 2 is good enough.
  199. * algorithm. It will consume O(W\*H\*numDisparities) bytes, which is large for 640x480 stereo and
  200. * huge for HD-size pictures. By default, it is set to false .
  201. *
  202. * The first constructor initializes StereoSGBM with all the default parameters. So, you only have to
  203. * set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter
  204. * to a custom value.
  205. */
  206. + (StereoSGBM*)create:(int)minDisparity numDisparities:(int)numDisparities blockSize:(int)blockSize P1:(int)P1 P2:(int)P2 disp12MaxDiff:(int)disp12MaxDiff preFilterCap:(int)preFilterCap uniquenessRatio:(int)uniquenessRatio speckleWindowSize:(int)speckleWindowSize NS_SWIFT_NAME(create(minDisparity:numDisparities:blockSize:P1:P2:disp12MaxDiff:preFilterCap:uniquenessRatio:speckleWindowSize:));
  207. /**
  208. * Creates StereoSGBM object
  209. *
  210. * @param minDisparity Minimum possible disparity value. Normally, it is zero but sometimes
  211. * rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
  212. * @param numDisparities Maximum disparity minus minimum disparity. The value is always greater than
  213. * zero. In the current implementation, this parameter must be divisible by 16.
  214. * @param blockSize Matched block size. It must be an odd number \>=1 . Normally, it should be
  215. * somewhere in the 3..11 range.
  216. * @param P1 The first parameter controlling the disparity smoothness. See below.
  217. * @param P2 The second parameter controlling the disparity smoothness. The larger the values are,
  218. * the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1
  219. * between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor
  220. * pixels. The algorithm requires P2 \> P1 . See stereo_match.cpp sample where some reasonably good
  221. * P1 and P2 values are shown (like 8\*number_of_image_channels\*blockSize\*blockSize and
  222. * 32\*number_of_image_channels\*blockSize\*blockSize , respectively).
  223. * @param disp12MaxDiff Maximum allowed difference (in integer pixel units) in the left-right
  224. * disparity check. Set it to a non-positive value to disable the check.
  225. * @param preFilterCap Truncation value for the prefiltered image pixels. The algorithm first
  226. * computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval.
  227. * The result values are passed to the Birchfield-Tomasi pixel cost function.
  228. * @param uniquenessRatio Margin in percentage by which the best (minimum) computed cost function
  229. * value should "win" the second best value to consider the found match correct. Normally, a value
  230. * within the 5-15 range is good enough.
  231. * and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the
  232. * 50-200 range.
  233. * filtering, set the parameter to a positive value, it will be implicitly multiplied by 16.
  234. * Normally, 1 or 2 is good enough.
  235. * algorithm. It will consume O(W\*H\*numDisparities) bytes, which is large for 640x480 stereo and
  236. * huge for HD-size pictures. By default, it is set to false .
  237. *
  238. * The first constructor initializes StereoSGBM with all the default parameters. So, you only have to
  239. * set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter
  240. * to a custom value.
  241. */
  242. + (StereoSGBM*)create:(int)minDisparity numDisparities:(int)numDisparities blockSize:(int)blockSize P1:(int)P1 P2:(int)P2 disp12MaxDiff:(int)disp12MaxDiff preFilterCap:(int)preFilterCap uniquenessRatio:(int)uniquenessRatio NS_SWIFT_NAME(create(minDisparity:numDisparities:blockSize:P1:P2:disp12MaxDiff:preFilterCap:uniquenessRatio:));
  243. /**
  244. * Creates StereoSGBM object
  245. *
  246. * @param minDisparity Minimum possible disparity value. Normally, it is zero but sometimes
  247. * rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
  248. * @param numDisparities Maximum disparity minus minimum disparity. The value is always greater than
  249. * zero. In the current implementation, this parameter must be divisible by 16.
  250. * @param blockSize Matched block size. It must be an odd number \>=1 . Normally, it should be
  251. * somewhere in the 3..11 range.
  252. * @param P1 The first parameter controlling the disparity smoothness. See below.
  253. * @param P2 The second parameter controlling the disparity smoothness. The larger the values are,
  254. * the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1
  255. * between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor
  256. * pixels. The algorithm requires P2 \> P1 . See stereo_match.cpp sample where some reasonably good
  257. * P1 and P2 values are shown (like 8\*number_of_image_channels\*blockSize\*blockSize and
  258. * 32\*number_of_image_channels\*blockSize\*blockSize , respectively).
  259. * @param disp12MaxDiff Maximum allowed difference (in integer pixel units) in the left-right
  260. * disparity check. Set it to a non-positive value to disable the check.
  261. * @param preFilterCap Truncation value for the prefiltered image pixels. The algorithm first
  262. * computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval.
  263. * The result values are passed to the Birchfield-Tomasi pixel cost function.
  264. * value should "win" the second best value to consider the found match correct. Normally, a value
  265. * within the 5-15 range is good enough.
  266. * and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the
  267. * 50-200 range.
  268. * filtering, set the parameter to a positive value, it will be implicitly multiplied by 16.
  269. * Normally, 1 or 2 is good enough.
  270. * algorithm. It will consume O(W\*H\*numDisparities) bytes, which is large for 640x480 stereo and
  271. * huge for HD-size pictures. By default, it is set to false .
  272. *
  273. * The first constructor initializes StereoSGBM with all the default parameters. So, you only have to
  274. * set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter
  275. * to a custom value.
  276. */
  277. + (StereoSGBM*)create:(int)minDisparity numDisparities:(int)numDisparities blockSize:(int)blockSize P1:(int)P1 P2:(int)P2 disp12MaxDiff:(int)disp12MaxDiff preFilterCap:(int)preFilterCap NS_SWIFT_NAME(create(minDisparity:numDisparities:blockSize:P1:P2:disp12MaxDiff:preFilterCap:));
  278. /**
  279. * Creates StereoSGBM object
  280. *
  281. * @param minDisparity Minimum possible disparity value. Normally, it is zero but sometimes
  282. * rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
  283. * @param numDisparities Maximum disparity minus minimum disparity. The value is always greater than
  284. * zero. In the current implementation, this parameter must be divisible by 16.
  285. * @param blockSize Matched block size. It must be an odd number \>=1 . Normally, it should be
  286. * somewhere in the 3..11 range.
  287. * @param P1 The first parameter controlling the disparity smoothness. See below.
  288. * @param P2 The second parameter controlling the disparity smoothness. The larger the values are,
  289. * the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1
  290. * between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor
  291. * pixels. The algorithm requires P2 \> P1 . See stereo_match.cpp sample where some reasonably good
  292. * P1 and P2 values are shown (like 8\*number_of_image_channels\*blockSize\*blockSize and
  293. * 32\*number_of_image_channels\*blockSize\*blockSize , respectively).
  294. * @param disp12MaxDiff Maximum allowed difference (in integer pixel units) in the left-right
  295. * disparity check. Set it to a non-positive value to disable the check.
  296. * computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval.
  297. * The result values are passed to the Birchfield-Tomasi pixel cost function.
  298. * value should "win" the second best value to consider the found match correct. Normally, a value
  299. * within the 5-15 range is good enough.
  300. * and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the
  301. * 50-200 range.
  302. * filtering, set the parameter to a positive value, it will be implicitly multiplied by 16.
  303. * Normally, 1 or 2 is good enough.
  304. * algorithm. It will consume O(W\*H\*numDisparities) bytes, which is large for 640x480 stereo and
  305. * huge for HD-size pictures. By default, it is set to false .
  306. *
  307. * The first constructor initializes StereoSGBM with all the default parameters. So, you only have to
  308. * set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter
  309. * to a custom value.
  310. */
  311. + (StereoSGBM*)create:(int)minDisparity numDisparities:(int)numDisparities blockSize:(int)blockSize P1:(int)P1 P2:(int)P2 disp12MaxDiff:(int)disp12MaxDiff NS_SWIFT_NAME(create(minDisparity:numDisparities:blockSize:P1:P2:disp12MaxDiff:));
  312. /**
  313. * Creates StereoSGBM object
  314. *
  315. * @param minDisparity Minimum possible disparity value. Normally, it is zero but sometimes
  316. * rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
  317. * @param numDisparities Maximum disparity minus minimum disparity. The value is always greater than
  318. * zero. In the current implementation, this parameter must be divisible by 16.
  319. * @param blockSize Matched block size. It must be an odd number \>=1 . Normally, it should be
  320. * somewhere in the 3..11 range.
  321. * @param P1 The first parameter controlling the disparity smoothness. See below.
  322. * @param P2 The second parameter controlling the disparity smoothness. The larger the values are,
  323. * the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1
  324. * between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor
  325. * pixels. The algorithm requires P2 \> P1 . See stereo_match.cpp sample where some reasonably good
  326. * P1 and P2 values are shown (like 8\*number_of_image_channels\*blockSize\*blockSize and
  327. * 32\*number_of_image_channels\*blockSize\*blockSize , respectively).
  328. * disparity check. Set it to a non-positive value to disable the check.
  329. * computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval.
  330. * The result values are passed to the Birchfield-Tomasi pixel cost function.
  331. * value should "win" the second best value to consider the found match correct. Normally, a value
  332. * within the 5-15 range is good enough.
  333. * and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the
  334. * 50-200 range.
  335. * filtering, set the parameter to a positive value, it will be implicitly multiplied by 16.
  336. * Normally, 1 or 2 is good enough.
  337. * algorithm. It will consume O(W\*H\*numDisparities) bytes, which is large for 640x480 stereo and
  338. * huge for HD-size pictures. By default, it is set to false .
  339. *
  340. * The first constructor initializes StereoSGBM with all the default parameters. So, you only have to
  341. * set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter
  342. * to a custom value.
  343. */
  344. + (StereoSGBM*)create:(int)minDisparity numDisparities:(int)numDisparities blockSize:(int)blockSize P1:(int)P1 P2:(int)P2 NS_SWIFT_NAME(create(minDisparity:numDisparities:blockSize:P1:P2:));
  345. /**
  346. * Creates StereoSGBM object
  347. *
  348. * @param minDisparity Minimum possible disparity value. Normally, it is zero but sometimes
  349. * rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
  350. * @param numDisparities Maximum disparity minus minimum disparity. The value is always greater than
  351. * zero. In the current implementation, this parameter must be divisible by 16.
  352. * @param blockSize Matched block size. It must be an odd number \>=1 . Normally, it should be
  353. * somewhere in the 3..11 range.
  354. * @param P1 The first parameter controlling the disparity smoothness. See below.
  355. * the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1
  356. * between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor
  357. * pixels. The algorithm requires P2 \> P1 . See stereo_match.cpp sample where some reasonably good
  358. * P1 and P2 values are shown (like 8\*number_of_image_channels\*blockSize\*blockSize and
  359. * 32\*number_of_image_channels\*blockSize\*blockSize , respectively).
  360. * disparity check. Set it to a non-positive value to disable the check.
  361. * computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval.
  362. * The result values are passed to the Birchfield-Tomasi pixel cost function.
  363. * value should "win" the second best value to consider the found match correct. Normally, a value
  364. * within the 5-15 range is good enough.
  365. * and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the
  366. * 50-200 range.
  367. * filtering, set the parameter to a positive value, it will be implicitly multiplied by 16.
  368. * Normally, 1 or 2 is good enough.
  369. * algorithm. It will consume O(W\*H\*numDisparities) bytes, which is large for 640x480 stereo and
  370. * huge for HD-size pictures. By default, it is set to false .
  371. *
  372. * The first constructor initializes StereoSGBM with all the default parameters. So, you only have to
  373. * set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter
  374. * to a custom value.
  375. */
  376. + (StereoSGBM*)create:(int)minDisparity numDisparities:(int)numDisparities blockSize:(int)blockSize P1:(int)P1 NS_SWIFT_NAME(create(minDisparity:numDisparities:blockSize:P1:));
  377. /**
  378. * Creates StereoSGBM object
  379. *
  380. * @param minDisparity Minimum possible disparity value. Normally, it is zero but sometimes
  381. * rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
  382. * @param numDisparities Maximum disparity minus minimum disparity. The value is always greater than
  383. * zero. In the current implementation, this parameter must be divisible by 16.
  384. * @param blockSize Matched block size. It must be an odd number \>=1 . Normally, it should be
  385. * somewhere in the 3..11 range.
  386. * the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1
  387. * between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor
  388. * pixels. The algorithm requires P2 \> P1 . See stereo_match.cpp sample where some reasonably good
  389. * P1 and P2 values are shown (like 8\*number_of_image_channels\*blockSize\*blockSize and
  390. * 32\*number_of_image_channels\*blockSize\*blockSize , respectively).
  391. * disparity check. Set it to a non-positive value to disable the check.
  392. * computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval.
  393. * The result values are passed to the Birchfield-Tomasi pixel cost function.
  394. * value should "win" the second best value to consider the found match correct. Normally, a value
  395. * within the 5-15 range is good enough.
  396. * and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the
  397. * 50-200 range.
  398. * filtering, set the parameter to a positive value, it will be implicitly multiplied by 16.
  399. * Normally, 1 or 2 is good enough.
  400. * algorithm. It will consume O(W\*H\*numDisparities) bytes, which is large for 640x480 stereo and
  401. * huge for HD-size pictures. By default, it is set to false .
  402. *
  403. * The first constructor initializes StereoSGBM with all the default parameters. So, you only have to
  404. * set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter
  405. * to a custom value.
  406. */
  407. + (StereoSGBM*)create:(int)minDisparity numDisparities:(int)numDisparities blockSize:(int)blockSize NS_SWIFT_NAME(create(minDisparity:numDisparities:blockSize:));
  408. /**
  409. * Creates StereoSGBM object
  410. *
  411. * @param minDisparity Minimum possible disparity value. Normally, it is zero but sometimes
  412. * rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
  413. * @param numDisparities Maximum disparity minus minimum disparity. The value is always greater than
  414. * zero. In the current implementation, this parameter must be divisible by 16.
  415. * somewhere in the 3..11 range.
  416. * the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1
  417. * between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor
  418. * pixels. The algorithm requires P2 \> P1 . See stereo_match.cpp sample where some reasonably good
  419. * P1 and P2 values are shown (like 8\*number_of_image_channels\*blockSize\*blockSize and
  420. * 32\*number_of_image_channels\*blockSize\*blockSize , respectively).
  421. * disparity check. Set it to a non-positive value to disable the check.
  422. * computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval.
  423. * The result values are passed to the Birchfield-Tomasi pixel cost function.
  424. * value should "win" the second best value to consider the found match correct. Normally, a value
  425. * within the 5-15 range is good enough.
  426. * and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the
  427. * 50-200 range.
  428. * filtering, set the parameter to a positive value, it will be implicitly multiplied by 16.
  429. * Normally, 1 or 2 is good enough.
  430. * algorithm. It will consume O(W\*H\*numDisparities) bytes, which is large for 640x480 stereo and
  431. * huge for HD-size pictures. By default, it is set to false .
  432. *
  433. * The first constructor initializes StereoSGBM with all the default parameters. So, you only have to
  434. * set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter
  435. * to a custom value.
  436. */
  437. + (StereoSGBM*)create:(int)minDisparity numDisparities:(int)numDisparities NS_SWIFT_NAME(create(minDisparity:numDisparities:));
  438. /**
  439. * Creates StereoSGBM object
  440. *
  441. * @param minDisparity Minimum possible disparity value. Normally, it is zero but sometimes
  442. * rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
  443. * zero. In the current implementation, this parameter must be divisible by 16.
  444. * somewhere in the 3..11 range.
  445. * the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1
  446. * between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor
  447. * pixels. The algorithm requires P2 \> P1 . See stereo_match.cpp sample where some reasonably good
  448. * P1 and P2 values are shown (like 8\*number_of_image_channels\*blockSize\*blockSize and
  449. * 32\*number_of_image_channels\*blockSize\*blockSize , respectively).
  450. * disparity check. Set it to a non-positive value to disable the check.
  451. * computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval.
  452. * The result values are passed to the Birchfield-Tomasi pixel cost function.
  453. * value should "win" the second best value to consider the found match correct. Normally, a value
  454. * within the 5-15 range is good enough.
  455. * and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the
  456. * 50-200 range.
  457. * filtering, set the parameter to a positive value, it will be implicitly multiplied by 16.
  458. * Normally, 1 or 2 is good enough.
  459. * algorithm. It will consume O(W\*H\*numDisparities) bytes, which is large for 640x480 stereo and
  460. * huge for HD-size pictures. By default, it is set to false .
  461. *
  462. * The first constructor initializes StereoSGBM with all the default parameters. So, you only have to
  463. * set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter
  464. * to a custom value.
  465. */
  466. + (StereoSGBM*)create:(int)minDisparity NS_SWIFT_NAME(create(minDisparity:));
  467. /**
  468. * Creates StereoSGBM object
  469. *
  470. * rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
  471. * zero. In the current implementation, this parameter must be divisible by 16.
  472. * somewhere in the 3..11 range.
  473. * the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1
  474. * between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor
  475. * pixels. The algorithm requires P2 \> P1 . See stereo_match.cpp sample where some reasonably good
  476. * P1 and P2 values are shown (like 8\*number_of_image_channels\*blockSize\*blockSize and
  477. * 32\*number_of_image_channels\*blockSize\*blockSize , respectively).
  478. * disparity check. Set it to a non-positive value to disable the check.
  479. * computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval.
  480. * The result values are passed to the Birchfield-Tomasi pixel cost function.
  481. * value should "win" the second best value to consider the found match correct. Normally, a value
  482. * within the 5-15 range is good enough.
  483. * and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the
  484. * 50-200 range.
  485. * filtering, set the parameter to a positive value, it will be implicitly multiplied by 16.
  486. * Normally, 1 or 2 is good enough.
  487. * algorithm. It will consume O(W\*H\*numDisparities) bytes, which is large for 640x480 stereo and
  488. * huge for HD-size pictures. By default, it is set to false .
  489. *
  490. * The first constructor initializes StereoSGBM with all the default parameters. So, you only have to
  491. * set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter
  492. * to a custom value.
  493. */
  494. + (StereoSGBM*)create NS_SWIFT_NAME(create());
  495. @end
  496. NS_ASSUME_NONNULL_END