I ran into this error message when I ran the following code:
char fileName[60];
//write new filname
sprintf(fileName,"/home/pi/Desktop/ML_TakeSample/DistanceMeasurement/image%i.png",i);
cout<<"saving "<< fileName <<endl;
//prep parameters for PNG file
vector<int> compression_params;
compression_params.push_back(IMWRITE_PNG_COMPRESSION);
compression_params.push_back(9);
//save to folder
imwrite(fileName, ToBeSaved[i], compression_params);
the error message:
error: (-2:Unspecified error) could not find a writer for the specified extension in function 'imwrite_'
When I look at others code that had the same error message, they didn't include .png or .jpg