1 | initial version |
If you want it to write it to another file, then you can use something like this inside the loop
stringstream ssfn;
ssfn << filenumber << ".png";
filename = ssfn.str();
filenumber++;
and for writing it to that file
crop = frame(roi);
imwrite(filename,crop);
If you want to write to the same file name
try
{
remove("fileName.ext");
}
catch(Exception e){}
crop = frame(roi);
imwrite("filename.ext",crop);