Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

What did you expect this to do? You always write the same image called "images.jpg". You could simply achieve your task via stringstreams (#include <sstream>)

if (response==1)
{
    stringstream file;
    file << "image" << count_4 << ".jpg";
    count_4++;

    cv::imwrite(file.str(), pre_img);

}

If you want to write to a certain folder, you could try this. Im not 100% sure this works on windows. On linux it worked with the linux folder structure.

file << "D:\images\image" << count_4 << ".jpg";