本文介绍了运行带有功能findchessboardcorners()的错误xmemory()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用OpenCV和MS Visual Studio 2013来简单地检测棋盘.它可以很好地编译和构建,但是在位于以下位置的xmemory0()文件中给出了运行时错误:

I am using OpenCV and MS Visual Studio 2013 to simply detect chessboard. It compiles and build all fine but gives a runtime error in xmemory0() file located in:

c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xmemory0

我似乎无法理解问题.任何想法将不胜感激.

I just cant seem to understand the problem. Any thought would be appreciated.

调试器在xmemory0()中中断,我认为findChessboardCorners()函数和库opencv-core2410中的问题.我在vs2010中尝试了相同的功能,并且可以正常工作,但是我需要在vs2013中使用它.

The debugger breaks in xmemory0(), I thought that the problem in findChessboardCorners() function and library opencv-core2410. I tried same function with vs2010 and it works, but I need to do it with vs2013.

推荐答案

辛苦工作后,我发现使用cv :: vector变量之前必须确定其大小,例如:

After hard work i found that i must determine the size of cv::vector variables before use it, for example:

cv::vector<Point2f> corners;
corners.resize(54);
bool patternfound = findChessboardCorners(gray, patternsize, corners,CV_CALIB_CB_ADAPTIVE_THRESH | CV_CALIB_CB_FAST_CHECK | CV_CALIB_CB_NORMALIZE_IMAGE);

我不需要在vs2010中调整向量的大小,而只需在vs2013中调整大小.

I didn't need to resize vector in vs2010 but just in vs2013.

这篇关于运行带有功能findchessboardcorners()的错误xmemory()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 00:34