Skip to content Skip to sidebar Skip to footer

Optical Flow Method Returning Unexpected Values

This past two weeks I have been trying to create an Android App that tracks points in space as I move my Samsung Galaxy III's camera. In short, I use the OpenCV libraries to try to

Solution 1:

prevGray = nextGray;

this shallow copy will lead to both Mat's point to the same pixel data. so, in the next iteration, when you say:

nextGray = inputFrame.gray();

prevGray will get updaded to the very same pixels, too ;)

what you want is a deep copy:

prevGray = nextGray.clone();prev2D = next2D.clone();  // same story..

Post a Comment for "Optical Flow Method Returning Unexpected Values"