Closed ajlangley closed 5 years ago
We need optical flow from "left" to "center" (to warp "left" so that it's similar to "center"), and optical flow from "right" to "center" (to warp "right" so that it becomes similar to "center". ) The (left, center right)-triplet is defined by our 12-frame hierarchical structure. That is, at the first level, (left, center, right) = (0, 6, 12). At the second level, its (0, 3, 6) and (6, 9, 12), and so on.
Using calcOpticalFlowFarneback should work (I tried it before), even though it might have a different definition of "x" and "y" from what the current code assumed. So you might need some simple post-processing on that (e.g. things like swapping x and y, normalizing them into [-1, 1], etc. )
Thank you! That helps a lot.
I have two questions about how to structure the optical flow files:
1) Each frame has 4 optical flow files associated with it: The x and y for the forward and backward flows, respectively. Does this mean the flow from frame n to n + 1 and the flow from frame n + 1 to n? Or does this mean we need the flow from frame n to n + 1, and n + 2 to n + 1?
2) If I'm using the calcOpticalFlowFarneback function from cv2 to produce the optical flow, is my understanding correct that this returns two arrays of pixels, one for the x and one for the y flows? Do you have any other recommendations for this?