Hi,
reference, OpenCv\samples\c\lkdemo.c
Anybody know what does the following snippet of codes does ?
Code extracted from lkdemo.c
for( i = k = 0; i < count; i++ )
{
if( add_remove_pt )
{
double dx = pt.x - points[1][i].x;
double dy = pt.y - points[1][i].y;
if( dx*dx + dy*dy <= 25 )
{
add_remove_pt = 0;
continue;
}
}
if( !status[i] )
continue;
points[1][k++] = points[1][i];
cvCircle( image, cvPointFrom32f(points[1][i]), 3, CV_RGB(0,255,0), -1, 8,0);
}
count = k;
Q1.
What does the bold line does ? >> points[1][k++] = points[1][i];
Why k++ ? I am confuse, thinking that next point is overwritten by the current point
Q2.
As cvCircle id drawn as the frame loops, where is the old points cleared and new point drawn ?
I look forward to your inputs.
Thanks =)