OpenCV 包含的错误
Error with OpenCV Includes
>请参阅下面的勾选答案:)错误 1 错误 C2065:"捕获":未声明的标识符
将VS2013 Express与OpenCV结合使用较旧的代码示例已经奏效,但我无法让这个示例:
#include <opencv2corecore.hpp>
#include <opencv2highguihighgui.hpp>
using namespace cv;
int main()
{
Mat frame = cvQueryFrame(capture);
imshow("Video", frame);
}
我不得不改变"opencv2/core/core.hpp"
到#include <opencv2corecore.hpp>
,它得到了那个位。但是我已经尝试过包括高贵,但我无法"capture"
工作?有什么想法吗?x64 调试,并使用 x64 库...
捕获部分是旧C-API的遗留物。
试试这个:
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/core/core.hpp"
using namespace cv;
int main()
{
VideoCapture cap(0);
while( cap.isOpened() )
{
Mat frame;
if ( ! cap.read(frame) )
break;
imshow("lalala",frame);
int k = waitKey(10);
if ( k==27 )
break;
}
return 0;
}
当然,
当您尚未声明变量capture
时,它将如何工作?可能你想做这样的事情:
#include <opencv2corecore.hpp>
#include <opencv2highguihighgui.hpp>
using namespace cv;
int main()
{
CvCapture* capture = cvCreateFileCapture("path to video file");
Mat frame = cvQueryFrame(capture);
imshow("Video", frame);
waitKey();
cvReleaseCapture(&capture);
}
相关文章:
- 在混合代码库中将C转换为C++时出现许多包含错误
- cmath抛出错误C2062、C2059、C2143和C2447.cmath包含在矢量文件中
- 为什么包含windows.h会产生语法错误,从而阻止类的实例化?(C2146,C2065)
- C++包含来自 #include "DevEngine/Core.h" 的错误
- CMake 错误"源似乎不包含 CMakeLists.txt",路径/库连接问题
- 配置:错误:找不到 MySQL 包含目录
- 即使我没有包含多个文件,C++中的多个定义错误
- Cython 包含catkin_pkg设置的错误
- CMake 错误 - 目标 foo INTERFACE_SOURCES属性包含在源目录中以前缀为前缀的路径
- 我包含了 std,但我仍然收到错误,这是为什么?
- 包含在 <WinSock2> Visual Studio 2015 中时出现错误
- 为什么更改包含 psapi.h 的顺序会产生编译错误?(标识符 BOOL 未定义)
- C++包含函数标头会给出错误'__dest'未命名类型
- vcpkg 安装 wxWidgts 但得到包含错误
- 为什么我在编译中经常出现错误:包含嵌套太深的 C++
- Visual Studio 中的意外错误包含文件
- 错误:包含windows.h时,未在作用域中声明SetLayeredWindowAttributes
- 链接器错误"包含无效的OMF记录"
- while 语句中的错误 - 包含 while 的函数未内联扩展
- LinkerOpencv3.0 上的错误包含项目