cv :: imwrite找不到指定扩展名的编写器 [英] cv::imwrite could not find a writer for the specified extension

查看:325
本文介绍了cv :: imwrite找不到指定扩展名的编写器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下命令导致异常.

cv::imwrite("test.jpg", diffImg);

我还对此进行了多种尝试,包括绝对路径和PNG导出.这是错误:

I also tried numerous variations on this, including absolute paths and PNG export. Here's the error:

0x75abd36f处的异常,代码:0xe06d7363:C ++异常,标志= 0x1 (无法继续执行)在opencv_core231!cv :: error

Exception at 0x75abd36f, code: 0xe06d7363: C++ exception, flags=0x1 (execution cannot be continued) in opencv_core231!cv::error

C:\ slave \ WinInstallerMegaPack \ src \ opencv \ modules \ highgui \ src \ loadsave.cpp:276: 错误:(-2)找不到指定扩展名的作者

C:\slave\WinInstallerMegaPack\src\opencv\modules\highgui\src\loadsave.cpp:276: error: (-2) could not find a writer for the specified extension

根据此相关主题我当前的OpenCV安装不支持我尝试的图像格式.但是我只是像他们的网站所建议的那样下载了预编译的Windows框架

According to this related thread my current OpenCV installation doesn't support the image formats I tried. But I merely downloaded the precompiled Windows framework like their site suggested.

如何使JPG导出正常工作?

How can I get JPG export working?

推荐答案

听起来好像您正在使用的编译环境不同.您可以尝试以下吗?下载依赖关系查看器并转到可执行目录,然后将.exe文件拖放到依赖关系查看器上( http://www. Dependencywalker.com/).它将向您显示它正在使用哪个运行时库. 现在,请确保您在正确的环境下调用该程序.如果可以的话,请使用命令行界面来调用该程序,这将使您更加安全地知道从何处调用代码,从而可以确保正在复制复制的.dll.

it sounds as if you were using a different execution environment than the one you are compiling. Can you try the following? Download dependency walker and go to the executable directory and drag and drop the .exe file over dependency walker (http://www.dependencywalker.com/). It will show you which runtime libraries it is using. Now, make sure you are calling the program with the right environment. If you can, use a command line interface to call the program, it will make you feel safer to know where the code is being called from, so you can be sure your copied .dlls are being called.

亲切的问候, 丹尼尔

这篇关于cv :: imwrite找不到指定扩展名的编写器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆