Simple Frame code issue
int main()
{
VideoCapture vid(0);
if(!vid.isOpened())
return 1;
double rate= vid.get(CV_CAP_PROP_FPS);
Mat frame,temp;
namedWindow("temp");
int delay=2000;
bool stop(false);
vid>>temp;
while(!stop)
{
vid>>frame;
imshow("temp",temp);
if(waitKey(delay)>=0)
stop=true;
}
imshow("Frame",frame);
imshow("Ex Frame",temp);
Mat dif=(temp - .5 * frame);
imshow("x frame",dif);
vid.release();
waitKey();
return 0;
}
In the above code the 'temp' is acquired before the loop and is shown in the loop and i expected to get only the first frame as output but i get the continuous frame output i just cant figure it out its just as if i've written "imshow("temp",frame);" Please help..silly thing...big headache...