Until now I can draw shapes from a binary image maskFrame into lastFrame as follows:
cv::Mat lastFrame, ;
std::vector <std::vector <cv::Point>> contours;
// frame processing ...
findContours(maskFrame, contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE);
drawContours(lastFrame, contours, -1, cv::Scalar(0), 2);
which should be the standard way..
Now, I would need to track these shapes for a least two frames. If I have a shape in frame(n), I would like to know if this shape is also present in frame(n - 1) by some possible information I could get, as area of the shape & position inside the frame.
Is it possible to achieve this ?