我正在尝试使用Visual Studio 2010 Express的opencv 2.3.我的代码来自示例:
#include "stdafx.h"
#include <highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{
int c;
// allocate memory for an image
IplImage *img;
// capture from video device #1
CvCapture* capture = cvCaptureFromCAM(1);
// create a window to display the images
cvNamedWindow("mainWin", CV_WINDOW_AUTOSIZE);
// position the window
cvMoveWindow("mainWin", 5, 5);
while(1)
{
// retrieve the captured frame
img=cvQueryFrame(capture);
// show the image in the window
cvShowImage("mainWin", img );
// wait 10 ms for a key to be pressed …Run Code Online (Sandbox Code Playgroud) 我正在将一个OpenCV 2.2应用程序从Unix(可以正常)移植到Windows 7 64位上,当调用cv :: imwrite时我收到以下异常
"未知函数中的OpenCV错误:未指定错误(找不到指定扩展名的编写器),文件highgui\src\loadsave.cpp"
原始的unix应用程序在我的Mac和Linux机器上运行良好.
有谁知道我可能缺少什么库或编译器配置,使这在Windows上工作?
更新:
为了让OpenCV运行,我做了以下事情:
事实上.bmp或.ppm不起作用这会引发更多问题:
再次感谢您帮助我调试此问题.