使用finContours函数和下载ntdll文件时出错
Error in using finContours function and downloading ntdll files
我是使用VS2012的新手&openCV用于完成我的五年规划,我必须使用轮廓检测人体(对象检测)。我已经成功安装了(VS2012 &openCV),一直在做一些基本的图像处理,没有任何未知的问题,除了逻辑或语法,直到我遇到使用findContours函数,我现在被拘留。我的问题是:
当我不使用轮廓相关的东西,即findContours, drawContours,通过评论它,一切都很好,我可以使用跟踪条来扩大/侵蚀图像,但是一旦我使用轮廓相关的东西并按下"F5",图像显示轮廓周围检测到的对象显示与断点一起说Program.exe触发了一个断点,因此我不能进一步使用它。
为方便起见,下面是堆栈跟踪中的清单:注1:我遵循了pbrandoli给出的说明,但在加载未突出显示的"ntdll.dll &msvcr "通过微软符号服务器被突出显示&在重新启动(ctrl +Shift+F5)或调试(F5)时,它再次得到不突出显示,表明它缺失。
注2:为方便起见,我已对列表进行了简化。
ntdll.dll!77ca5204() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!77c6fbae() Unknown
ntdll.dll!77c02b04() Unknown
KernelBase.dll!75ff7e27() Unknown
> msvcr110d.dll!_CrtIsValidHeapPointer(const void * pUserData) Line 2036 C++
msvcr110d.dll!_free_dbg_nolock(void * pUserData, int nBlockUse) Line 1322 C++
msvcr110d.dll!_free_dbg(void * pUserData, int nBlockUse) Line 1265 C++
msvcr110d.dll!operator delete(void * pUserData) Line 54 C++
binaryFrame.exe!std::allocator<cv::Point_<int> >::deallocate(cv::Point_<int> * _Ptr,
unsigned int __formal) Line 586 C++
binaryFrame.exe!std::_Wrap_alloc<std::allocator<cv::Point_<int> >
>::deallocate(cv::Point_<int> * _Ptr, unsigned int _Count) Line 888 C++
binaryFrame.exe!std::vector<cv::Point_<int>,std::allocator<cv::Point_<int> > >::_Tidy()
binaryFrame.exe!showBinImage() Line 66 C++
binaryFrame.exe!main(int __formal, char * * argv) Line 21 C++
binaryFrame.exe!__tmainCRTStartup() Line 536 C
binaryFrame.exe!mainCRTStartup() Line 377 C
kernel32.dll!763e1154() Unknown
ntdll.dll!77c3b299() Unknown
ntdll.dll!77c3b26c() Unknown
下面是我在图像中用于轮廓检测的代码:
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
using namespace cv;
using namespace std;
void showBinImage();
int val=2;
int main( int, char** argv )
{
showBinImage();
return 0;
}
void showBinImage(){
Mat bin;
Mat im_gray;
Mat im_rgb = imread("nk5.jpg");
// Trackbar
namedWindow("ErodedImage",1);
createTrackbar("Erode", "ErodedImage", &val, 50);
cvtColor(im_rgb, im_gray,CV_RGB2GRAY);
threshold(im_gray, bin, 128.0, 255.0, THRESH_BINARY_INV);
//imwrite("bnasir.jpg", img_bw);
namedWindow("Binary",1);
imshow("Binary", bin);
while (true)
{
Mat erodeElement = getStructuringElement( MORPH_CROSS,Size(val*3,val*3));
Mat dilateElement = getStructuringElement( MORPH_RECT,Size(val*8,val*8));
Mat eroded; // the destination image
erode(bin,eroded,erodeElement+50);
dilate(eroded,eroded,dilateElement);
std::vector<std::vector<cv::Point>> contours;
findContours(eroded, contours, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
// Draw black contours on a white image
Mat result(eroded.size(),CV_8U,cv::Scalar(255));
drawContours(result,contours,-1, cv::Scalar(0), 2); // with a thickness of 2
imshow("ErodedImage",(eroded));
waitKey(10);
}
}
我从VS2012切换到VS2010,现在一切都很好!我不知道VS2012的问题是什么,因为VS2013也提供了VS2010的结果,但要使用VS2013,你需要Windows 8操作系统。因此我回到了旧版本,因为我使用的是Windows 7操作系统!
相关文章:
- 读取文件的最后一行并输入到链接列表时出错
- C++-试图将函数指针推回到另一个CPP文件中的矢量时出错
- .h 和.cpp文件分离时出错,但仅使用 .h 文件时没有错误.我做错了什么?
- 在 C/C++ 中打开驻留在 "/sys/" 下的文件时出错
- 在头文件中定义变量不会出错
- 如何在多写入器情况下对文件支持的共享内存中的大页面出错
- JNI,使用两个 .so 文件时出错,其中一个文件需要另一个文件
- 生成文件中隐式规则中的 -c 标志出错
- 编译时出错 - 链接.cpp和头文件
- 从人员矢量插入和读取文件时出错
- LNK2019 在文件中调用静态成员的方法时出错.cpp
- ./main:加载共享库时出错:libopencv_highgui.so.4.0:无法打开共享对象文件:没有这样的文件或
- 猫鼬 - 包含标准C++库文件时出错
- 在f2c.h文件中定义min()max()宏时出错
- ASIOSDK;从hostsample.cpp生成mex文件时出错
- 使用emscripten将c++文件转换为wasm时出错
- 编译后可执行文件出错
- 头文件C++出错
- ftell 非常大的文件出错
- 从磁盘读取映像文件出错