1 | initial version |
Your approach is good, but you I would suggest you a little modification:
int cntr = 0:
// ...
// saving part:
std::string savingName = "/home/administrator/Desktop/bg_sub/" + std::to_string(++cntr) + ".jpg";
cv::imwrite(savingName, image);