Ask Your Question

Example of SparsePyrLKOpticalFlow

asked 2017-06-02 21:26:13 -0500


I'm trying to refactor old code which uses "cvCalcOpticalFlowPyrLK" ( With new cuda function cv::cuda::SparsePyrLKOpticalFlow::calc but I cannot find any example of usage.

Can anyone please post me some example of correct use of this method, (of all the input structures and what should I receive)?

Thanks a lot

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-06-02 21:49:30 -0500

Tetragramm gravatar image

It is essentially the same as the non-CUDA version, with the exception of the image input types, which should be CUDA Mats. You can see a bit of sample code HERE.

edit flag offensive delete link more


How can I use a FAST_GPU function to detect the features and then use PyrLKOpticalFlow? The GpuMat format that is returned from FAST_GPU is of a different type than the one Pyr LK Optical Flow accepts.

kjoshi gravatar imagekjoshi ( 2018-03-20 06:22:11 -0500 )edit

Check out the static function convert.

Also, it's best to start a new question rather than resurrect old ones.

Tetragramm gravatar imageTetragramm ( 2018-03-20 07:55:18 -0500 )edit

I apologize for that. Thanks a lot for your response. I have created a new question her. FAST_GPU with CalcOpticalFlow

kjoshi gravatar imagekjoshi ( 2018-03-20 08:01:56 -0500 )edit

Question Tools

1 follower


Asked: 2017-06-02 21:26:13 -0500

Seen: 749 times

Last updated: Jun 02 '17