001// 002// This file is auto-generated. Please don't modify it! 003// 004package org.opencv.video; 005 006import org.opencv.video.DISOpticalFlow; 007import org.opencv.video.DenseOpticalFlow; 008 009// C++: class DISOpticalFlow 010/** 011 * DIS optical flow algorithm. 012 * 013 * This class implements the Dense Inverse Search (DIS) optical flow algorithm. More 014 * details about the algorithm can be found at CITE: Kroeger2016 . Includes three presets with preselected 015 * parameters to provide reasonable trade-off between speed and quality. However, even the slowest preset is 016 * still relatively fast, use DeepFlow if you need better quality and don't care about speed. 017 * 018 * This implementation includes several additional features compared to the algorithm described in the paper, 019 * including spatial propagation of flow vectors (REF: getUseSpatialPropagation), as well as an option to 020 * utilize an initial flow approximation passed to REF: calc (which is, essentially, temporal propagation, 021 * if the previous frame's flow field is passed). 022 */ 023public class DISOpticalFlow extends DenseOpticalFlow { 024 025 protected DISOpticalFlow(long addr) { super(addr); } 026 027 // internal usage only 028 public static DISOpticalFlow __fromPtr__(long addr) { return new DISOpticalFlow(addr); } 029 030 // C++: enum <unnamed> 031 public static final int 032 PRESET_ULTRAFAST = 0, 033 PRESET_FAST = 1, 034 PRESET_MEDIUM = 2; 035 036 037 // 038 // C++: int cv::DISOpticalFlow::getFinestScale() 039 // 040 041 /** 042 * Finest level of the Gaussian pyramid on which the flow is computed (zero level 043 * corresponds to the original image resolution). The final flow is obtained by bilinear upscaling. 044 * SEE: setFinestScale 045 * @return automatically generated 046 */ 047 public int getFinestScale() { 048 return getFinestScale_0(nativeObj); 049 } 050 051 052 // 053 // C++: void cv::DISOpticalFlow::setFinestScale(int val) 054 // 055 056 /** 057 * getFinestScale SEE: getFinestScale 058 * @param val automatically generated 059 */ 060 public void setFinestScale(int val) { 061 setFinestScale_0(nativeObj, val); 062 } 063 064 065 // 066 // C++: int cv::DISOpticalFlow::getPatchSize() 067 // 068 069 /** 070 * Size of an image patch for matching (in pixels). Normally, default 8x8 patches work well 071 * enough in most cases. 072 * SEE: setPatchSize 073 * @return automatically generated 074 */ 075 public int getPatchSize() { 076 return getPatchSize_0(nativeObj); 077 } 078 079 080 // 081 // C++: void cv::DISOpticalFlow::setPatchSize(int val) 082 // 083 084 /** 085 * getPatchSize SEE: getPatchSize 086 * @param val automatically generated 087 */ 088 public void setPatchSize(int val) { 089 setPatchSize_0(nativeObj, val); 090 } 091 092 093 // 094 // C++: int cv::DISOpticalFlow::getPatchStride() 095 // 096 097 /** 098 * Stride between neighbor patches. Must be less than patch size. Lower values correspond 099 * to higher flow quality. 100 * SEE: setPatchStride 101 * @return automatically generated 102 */ 103 public int getPatchStride() { 104 return getPatchStride_0(nativeObj); 105 } 106 107 108 // 109 // C++: void cv::DISOpticalFlow::setPatchStride(int val) 110 // 111 112 /** 113 * getPatchStride SEE: getPatchStride 114 * @param val automatically generated 115 */ 116 public void setPatchStride(int val) { 117 setPatchStride_0(nativeObj, val); 118 } 119 120 121 // 122 // C++: int cv::DISOpticalFlow::getGradientDescentIterations() 123 // 124 125 /** 126 * Maximum number of gradient descent iterations in the patch inverse search stage. Higher values 127 * may improve quality in some cases. 128 * SEE: setGradientDescentIterations 129 * @return automatically generated 130 */ 131 public int getGradientDescentIterations() { 132 return getGradientDescentIterations_0(nativeObj); 133 } 134 135 136 // 137 // C++: void cv::DISOpticalFlow::setGradientDescentIterations(int val) 138 // 139 140 /** 141 * getGradientDescentIterations SEE: getGradientDescentIterations 142 * @param val automatically generated 143 */ 144 public void setGradientDescentIterations(int val) { 145 setGradientDescentIterations_0(nativeObj, val); 146 } 147 148 149 // 150 // C++: int cv::DISOpticalFlow::getVariationalRefinementIterations() 151 // 152 153 /** 154 * Number of fixed point iterations of variational refinement per scale. Set to zero to 155 * disable variational refinement completely. Higher values will typically result in more smooth and 156 * high-quality flow. 157 * SEE: setGradientDescentIterations 158 * @return automatically generated 159 */ 160 public int getVariationalRefinementIterations() { 161 return getVariationalRefinementIterations_0(nativeObj); 162 } 163 164 165 // 166 // C++: void cv::DISOpticalFlow::setVariationalRefinementIterations(int val) 167 // 168 169 /** 170 * getGradientDescentIterations SEE: getGradientDescentIterations 171 * @param val automatically generated 172 */ 173 public void setVariationalRefinementIterations(int val) { 174 setVariationalRefinementIterations_0(nativeObj, val); 175 } 176 177 178 // 179 // C++: float cv::DISOpticalFlow::getVariationalRefinementAlpha() 180 // 181 182 /** 183 * Weight of the smoothness term 184 * SEE: setVariationalRefinementAlpha 185 * @return automatically generated 186 */ 187 public float getVariationalRefinementAlpha() { 188 return getVariationalRefinementAlpha_0(nativeObj); 189 } 190 191 192 // 193 // C++: void cv::DISOpticalFlow::setVariationalRefinementAlpha(float val) 194 // 195 196 /** 197 * getVariationalRefinementAlpha SEE: getVariationalRefinementAlpha 198 * @param val automatically generated 199 */ 200 public void setVariationalRefinementAlpha(float val) { 201 setVariationalRefinementAlpha_0(nativeObj, val); 202 } 203 204 205 // 206 // C++: float cv::DISOpticalFlow::getVariationalRefinementDelta() 207 // 208 209 /** 210 * Weight of the color constancy term 211 * SEE: setVariationalRefinementDelta 212 * @return automatically generated 213 */ 214 public float getVariationalRefinementDelta() { 215 return getVariationalRefinementDelta_0(nativeObj); 216 } 217 218 219 // 220 // C++: void cv::DISOpticalFlow::setVariationalRefinementDelta(float val) 221 // 222 223 /** 224 * getVariationalRefinementDelta SEE: getVariationalRefinementDelta 225 * @param val automatically generated 226 */ 227 public void setVariationalRefinementDelta(float val) { 228 setVariationalRefinementDelta_0(nativeObj, val); 229 } 230 231 232 // 233 // C++: float cv::DISOpticalFlow::getVariationalRefinementGamma() 234 // 235 236 /** 237 * Weight of the gradient constancy term 238 * SEE: setVariationalRefinementGamma 239 * @return automatically generated 240 */ 241 public float getVariationalRefinementGamma() { 242 return getVariationalRefinementGamma_0(nativeObj); 243 } 244 245 246 // 247 // C++: void cv::DISOpticalFlow::setVariationalRefinementGamma(float val) 248 // 249 250 /** 251 * getVariationalRefinementGamma SEE: getVariationalRefinementGamma 252 * @param val automatically generated 253 */ 254 public void setVariationalRefinementGamma(float val) { 255 setVariationalRefinementGamma_0(nativeObj, val); 256 } 257 258 259 // 260 // C++: bool cv::DISOpticalFlow::getUseMeanNormalization() 261 // 262 263 /** 264 * Whether to use mean-normalization of patches when computing patch distance. It is turned on 265 * by default as it typically provides a noticeable quality boost because of increased robustness to 266 * illumination variations. Turn it off if you are certain that your sequence doesn't contain any changes 267 * in illumination. 268 * SEE: setUseMeanNormalization 269 * @return automatically generated 270 */ 271 public boolean getUseMeanNormalization() { 272 return getUseMeanNormalization_0(nativeObj); 273 } 274 275 276 // 277 // C++: void cv::DISOpticalFlow::setUseMeanNormalization(bool val) 278 // 279 280 /** 281 * getUseMeanNormalization SEE: getUseMeanNormalization 282 * @param val automatically generated 283 */ 284 public void setUseMeanNormalization(boolean val) { 285 setUseMeanNormalization_0(nativeObj, val); 286 } 287 288 289 // 290 // C++: bool cv::DISOpticalFlow::getUseSpatialPropagation() 291 // 292 293 /** 294 * Whether to use spatial propagation of good optical flow vectors. This option is turned on by 295 * default, as it tends to work better on average and can sometimes help recover from major errors 296 * introduced by the coarse-to-fine scheme employed by the DIS optical flow algorithm. Turning this 297 * option off can make the output flow field a bit smoother, however. 298 * SEE: setUseSpatialPropagation 299 * @return automatically generated 300 */ 301 public boolean getUseSpatialPropagation() { 302 return getUseSpatialPropagation_0(nativeObj); 303 } 304 305 306 // 307 // C++: void cv::DISOpticalFlow::setUseSpatialPropagation(bool val) 308 // 309 310 /** 311 * getUseSpatialPropagation SEE: getUseSpatialPropagation 312 * @param val automatically generated 313 */ 314 public void setUseSpatialPropagation(boolean val) { 315 setUseSpatialPropagation_0(nativeObj, val); 316 } 317 318 319 // 320 // C++: static Ptr_DISOpticalFlow cv::DISOpticalFlow::create(int preset = DISOpticalFlow::PRESET_FAST) 321 // 322 323 /** 324 * Creates an instance of DISOpticalFlow 325 * 326 * @param preset one of PRESET_ULTRAFAST, PRESET_FAST and PRESET_MEDIUM 327 * @return automatically generated 328 */ 329 public static DISOpticalFlow create(int preset) { 330 return DISOpticalFlow.__fromPtr__(create_0(preset)); 331 } 332 333 /** 334 * Creates an instance of DISOpticalFlow 335 * 336 * @return automatically generated 337 */ 338 public static DISOpticalFlow create() { 339 return DISOpticalFlow.__fromPtr__(create_1()); 340 } 341 342 343 @Override 344 protected void finalize() throws Throwable { 345 delete(nativeObj); 346 } 347 348 349 350 // C++: int cv::DISOpticalFlow::getFinestScale() 351 private static native int getFinestScale_0(long nativeObj); 352 353 // C++: void cv::DISOpticalFlow::setFinestScale(int val) 354 private static native void setFinestScale_0(long nativeObj, int val); 355 356 // C++: int cv::DISOpticalFlow::getPatchSize() 357 private static native int getPatchSize_0(long nativeObj); 358 359 // C++: void cv::DISOpticalFlow::setPatchSize(int val) 360 private static native void setPatchSize_0(long nativeObj, int val); 361 362 // C++: int cv::DISOpticalFlow::getPatchStride() 363 private static native int getPatchStride_0(long nativeObj); 364 365 // C++: void cv::DISOpticalFlow::setPatchStride(int val) 366 private static native void setPatchStride_0(long nativeObj, int val); 367 368 // C++: int cv::DISOpticalFlow::getGradientDescentIterations() 369 private static native int getGradientDescentIterations_0(long nativeObj); 370 371 // C++: void cv::DISOpticalFlow::setGradientDescentIterations(int val) 372 private static native void setGradientDescentIterations_0(long nativeObj, int val); 373 374 // C++: int cv::DISOpticalFlow::getVariationalRefinementIterations() 375 private static native int getVariationalRefinementIterations_0(long nativeObj); 376 377 // C++: void cv::DISOpticalFlow::setVariationalRefinementIterations(int val) 378 private static native void setVariationalRefinementIterations_0(long nativeObj, int val); 379 380 // C++: float cv::DISOpticalFlow::getVariationalRefinementAlpha() 381 private static native float getVariationalRefinementAlpha_0(long nativeObj); 382 383 // C++: void cv::DISOpticalFlow::setVariationalRefinementAlpha(float val) 384 private static native void setVariationalRefinementAlpha_0(long nativeObj, float val); 385 386 // C++: float cv::DISOpticalFlow::getVariationalRefinementDelta() 387 private static native float getVariationalRefinementDelta_0(long nativeObj); 388 389 // C++: void cv::DISOpticalFlow::setVariationalRefinementDelta(float val) 390 private static native void setVariationalRefinementDelta_0(long nativeObj, float val); 391 392 // C++: float cv::DISOpticalFlow::getVariationalRefinementGamma() 393 private static native float getVariationalRefinementGamma_0(long nativeObj); 394 395 // C++: void cv::DISOpticalFlow::setVariationalRefinementGamma(float val) 396 private static native void setVariationalRefinementGamma_0(long nativeObj, float val); 397 398 // C++: bool cv::DISOpticalFlow::getUseMeanNormalization() 399 private static native boolean getUseMeanNormalization_0(long nativeObj); 400 401 // C++: void cv::DISOpticalFlow::setUseMeanNormalization(bool val) 402 private static native void setUseMeanNormalization_0(long nativeObj, boolean val); 403 404 // C++: bool cv::DISOpticalFlow::getUseSpatialPropagation() 405 private static native boolean getUseSpatialPropagation_0(long nativeObj); 406 407 // C++: void cv::DISOpticalFlow::setUseSpatialPropagation(bool val) 408 private static native void setUseSpatialPropagation_0(long nativeObj, boolean val); 409 410 // C++: static Ptr_DISOpticalFlow cv::DISOpticalFlow::create(int preset = DISOpticalFlow::PRESET_FAST) 411 private static native long create_0(int preset); 412 private static native long create_1(); 413 414 // native support for java finalize() 415 private static native void delete(long nativeObj); 416 417}