0

我正在使用 OpenCV 2.4.6,并尝试生成一些直方图。原始示例代码从本地存储中获取图像,但我对其进行了修改以使用VideoCapture对象。当代码到达时cv::split(),它会带来一个未处理的异常。它提示:

“visionProject.exe 中 0x5465B3D9 (opencv_core246.dll) 处的未处理异常:0xC0000005:访问冲突写入位置 0x1800E633。”

我的代码是这样的:

            VideoCapture camera;
            camera.open(0);

            camera >> src;

            if( !src.data )
                { return -1; }

            /// Separate the image in 3 places ( B, G and R )
            vector <Mat> bgr_planes;
            split(src, bgr_planes );

谢谢你的时间。

4

1 回答 1

0

多亏了朋友的帮助,我才得以成功。为了OpenCV正常工作,我必须在Visual Studio中将构建设置为 Release 。这样,它就可以正常工作。

于 2013-11-01T21:39:35.167 回答