Calculate Optical Flow using foreground mask

747 Views Asked by At

I am using calcOpticalFlowPyrLK() to calculate Optical Flow. However, instead of using good features to track, I am now using background subtraction to get the foreground image mask and pass it to the calcOpticalFlowPyrLK(). But I am not very sure how to pass foreground mask directly to calcOpticalFlowPyrLK(). Do I have to scan through the foreground mask and store all the foreground pixels to a vector then pass it to calcOpticalFlowPyrLK()?

Is there other solution where we can combine background subtraction and optical flow efficiently?

0

There are 0 best solutions below