Ask Your Question

Revision history [back]

Basically your problem is that you are storing the image within a time stamp of seconds. However, the processing processes multiple image frames within a second, overwriting your frame each time.

You have to create a unique timestamp. You can do this by adding a counter that increases with each write and adds a value at the end of your filename OR you could go down to millisecond level by using the tics functionality.

clock_t time;
time= clock();
double result = (float)time)/CLOCKS_PER_SEC;

This will output values like 0.022 for example. Multiply it with 1000 and you have a unique number combined with the second value you already reached before.