Hi guys.. I am trying to track object (head) and based on the position move a PTU (Pan-tilt unit) based on where the head is located.
So i am using Lukas kanade optical flow to track the movement of the face.. I quickly realized that it has some issues with points drifting away, for which i tried to come up with a fix. So my idea is to look at the goodFeatures as a distribution, with a µ and the standard deviation.
So to prevent outliers, i try to keep my goodFeatures within 1 standardDeviation (or close to µ), such that I Only keep points which is closest to my head. When i come to a time where the amount of GoodFeatures, which is used to track becomes below a threshold value, I re initiate the goodFeaturesToTrack function to get new points which will be used for tracking, from a mask which keeps getting updated as long the standard deviation is acceptable.
Problem is though that the reinitiating does occur as expected since i am not able to erase all points without the program crashes, which I hoped you would be able to help..
My code is on Github: https://github.com/Keerthikan/PTU-Facetracker/tree/master/own
Furthermore what do you guys think of the way of tackling the problem, It's simple, and maybe too simple??..
Feedback and improvement is well appreciated :)