First time here? Check out the FAQ!

Ask Your Question
1

how to use calcOpticalFlowSF

asked Dec 21 '12

bagheraa gravatar image

Hello, I'm new to OpenCV, y I dont have meny skills on OpenCV 2. I'm trying to use the function calcOpticalFlowSF(), but the documentation on this item in docs.opencv.org seem to be wrong. In the header of the c++ it says:

void calcOpticalFlowSF(Mat& from, Mat& to, Mat& flow, int layers, int averaging_block_size, int max_flow, 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)

that sums a total of 16 parameters, but in the explanation of the parameters the Matrix 'flow' doesn't appear. In its place it appears two Matrices: 'flowX' and 'flowY'.

I have checked the library header, and the function call is like the one on the docs. So I have suppossed that 'flow' is a void matrix that will be filled by the function.

The problem is that when I call the function, it hangs and waits forever.

How must I call the function? Must I prepare flow as a two float channel image?

Preview: (hide)

1 answer

Sort by » oldest newest most voted
0

answered Dec 21 '12

There is C++ sample for calcOpticalFlowSF in <opencv_root>/samples/cpp/simpleflow_demo.cpp.

Preview: (hide)

Comments

The demo doesn't really help. No matter if I call the function with the arguments provided in the demo the function never returns. What is the time complexity for this algorithm compared to the image resolution?

erenik gravatar imageerenik (Aug 4 '14)edit

Question Tools

Stats

Asked: Dec 21 '12

Seen: 2,630 times

Last updated: Dec 21 '12