Fix for - OpenCV Error:Unspeicifed Error - [closed]
error:
OpenCV Error: Unspecified error (could not find a writer for the specified extension) in imwrite_, file /temp/binarydeb/ros-kinetic-opencv3-3.2.0/modules/imgcodecs/src/loadsave.cpp, line 531
terminate called after throwing an instance of 'cv::Exception'
what(): /temp/binarydeb/ros-kinetic-opencv3-3.2.0/modules/imgcodecs/src/loadsave.cpp, line 531: error: (-2) could not find a writer for the specified extension in function imwrite_
Aborted(core dumped)
while running my application i am facing openCE Error and my code is getting core dumped and halting my code execution , please provide fix for this issue asap.
Here is the code snippet.
vector<int> compression_params; //vector that stores the compression parameters of the image
compression_params.push_back(CV_IMWRITE_JPEG_QUALITY); //specify the compression technique
compression_params.push_back(98); //specify the compression quality
bool bSuccess = imwrite(jpegImage.c_str(), img, compression_params); //exception is received here
Below is the jpegImage name with .jpg extension .
string socket_server::jpegImage = "TestImage.jpg";
Regards Anjaneyulu