Optical flow, vectors do not seem quite right/are unexpected (video inside)

I made a simple test movie to play with the optical flow SDK. The movie is two textured rectangles, one stationary, the other moving from left to right and back.

Working on 8 bit greyscale, after acquiring the flow I divide the vector components by 32.0f to convert from fixed point to float. I’m using NV_OF_OUTPUT_VECTOR_GRID_SIZE_1 at this stage, along with NV_OF_PERF_LEVEL_SLOW. I’m iterating over the image in steps of 32, taking the direction vector at each position and drawing it onto a bitmap. I’m presenting each frame of the original video one at a time, with the most recent frame becoming the reference frame for the next iteration.

Would anyone care to speculate/give me some ideas as to why the vectors look like this? Is there a problem at the boundary, for example? They appear to be very large. Do I have to normalise them somehow, other than dividing the components by 32? What mistake do you think I’ve made here?

The issue was the black areas. Black/textureless areas are impossible for the engine to make a hypothesis about, so we have chaos in there. I tried it with another set of frames that doesn’t have these and it works nicely. I will research how to filter them anyway, because scenes quite often have dark/textureless things in them, especially at night (and in IR).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.