1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-18 17:24:28 +08:00

Sparse-to-dense OF algorithm is added

* Sparse match interpolator interface and EdgeAwareInterpolator were
added to the ximgproc module
* New optical flow algorithm, based on PyrLK sparse OF and sparse match
interpolation, is added to the optflow module
This commit is contained in:
sbokov
2015-09-15 17:55:40 +03:00
parent 6a0545e6fe
commit 831523ce02
11 changed files with 1543 additions and 3 deletions

View File

@@ -109,7 +109,30 @@ CV_EXPORTS_W void calcOpticalFlowSF( InputArray from, InputArray to, OutputArray
double sigma_dist, double sigma_color, int postprocess_window,
double sigma_dist_fix, double sigma_color_fix, double occ_thr,
int upscale_averaging_radius, double upscale_sigma_dist,
double upscale_sigma_color, double speed_up_thr );
double upscale_sigma_color, double speed_up_thr );
/** @brief Fast dense optical flow based on PyrLK sparse matches interpolation.
@param from first 8-bit 3-channel or 1-channel image.
@param to second 8-bit 3-channel or 1-channel image of the same size as from
@param flow computed flow image that has the same size as from and CV_32FC2 type
@param grid_step stride used in sparse match computation. Lower values usually
result in higher quality but slow down the algorithm.
@param k number of nearest-neighbor matches considered, when fitting a locally affine
model. Lower values can make the algorithm noticeably faster at the cost of
some quality degradation.
@param sigma parameter defining how fast the weights decrease in the locally-weighted affine
fitting. Higher values can help preserve fine details, lower values can help to get rid
of the noise in the output flow.
@param use_post_proc defines whether the ximgproc::fastGlobalSmootherFilter() is used
for post-processing after interpolation
@param fgs_lambda see the respective parameter of the ximgproc::fastGlobalSmootherFilter()
@param fgs_sigma see the respective parameter of the ximgproc::fastGlobalSmootherFilter()
*/
CV_EXPORTS_W void calcOpticalFlowSparseToDense ( InputArray from, InputArray to, OutputArray flow,
int grid_step = 8, int k = 128, float sigma = 0.05f,
bool use_post_proc = true, float fgs_lambda = 500.0f,
float fgs_sigma = 1.5f );
/** @brief Read a .flo file
@@ -165,6 +188,9 @@ CV_EXPORTS_W Ptr<DenseOpticalFlow> createOptFlow_SimpleFlow();
//! Additional interface to the Farneback's algorithm - calcOpticalFlowFarneback()
CV_EXPORTS_W Ptr<DenseOpticalFlow> createOptFlow_Farneback();
//! Additional interface to the SparseToDenseFlow algorithm - calcOpticalFlowSparseToDense()
CV_EXPORTS_W Ptr<DenseOpticalFlow> createOptFlow_SparseToDense();
//! @}
} //optflow