Ask Your Question

Fix for - OpenCV Error:Unspeicifed Error - [closed]

asked 2017-08-11 07:47:29 -0500

can-43811 gravatar image

updated 2017-08-12 08:10:41 -0500

lucasw gravatar image


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

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2019-05-20 02:30:36.799284

1 Answer

Sort by ยป oldest newest most voted

answered 2017-08-11 13:47:44 -0500

sumanth gravatar image

updated 2017-08-11 13:49:47 -0500

Sharing the source code where it gives an error will help to identify the problem.!

But from the error "could not find a writer for the specified extension in function imwrite_", I expect that you might not have given the type of image in the imwrite (for instance .png or .jpg) this tells imwrite how to save the image.

edit flag offensive delete link more


I have updated the question with more info . kindly check

can-43811 gravatar image can-43811  ( 2017-08-12 03:22:45 -0500 )edit

Question Tools

1 follower


Asked: 2017-08-11 07:47:29 -0500

Seen: 624 times

Last updated: Aug 12 '17