ofxCv::FlowPyrLK tracking

@kylemcdonald
i am looking at your example-flow-keypoints that uses ofxCv::FlowPyrLK.
i was hoping to use it to track people.

right now i am trying to work out how to eliminate keyPoints that stop moving or hit the edge of the video and get stuck there.
i was able to use ofInRange to eliminate those points that for some reason moved outside the 640x480 pixel video images.
At some points some keyPoints get lost and attach themselves to non-moving parts of the image.
I was hooping to use getMotion() to check each points’ motion vector.
But something like this doesn’t seem to connect the right motion info to the right points after some keyPoints hit the edges of the video:

    for(int i=0; i<flow.getCurrent().size();i++){
       ofDrawLine(flow.getCurrent()[i],flow.getCurrent()[i]+ (flow.getMotion()[i+flow.getCurrent().size()]*20));
    }

any ideas?
here is the of 0.9.0 OS X 10.10 project:

good question, but i’m not sure, i don’t usually work with the lkflow technique. @obviousjim contributed this code to ofxCv, maybe he has an idea?

I never used the PyrLK Flow technique either - always the dense flow. Wish I knew more…

ok thanks guys.