ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

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

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

can-43811 gravatar image

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

lucasw gravatar image

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

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
0

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

sumanth gravatar image

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

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

Comments

I have updated the question with more info . kindly check

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

Question Tools

1 follower

Stats

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

Seen: 774 times

Last updated: Aug 12 '17