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?