【问题标题】:Error in using finContours function and downloading ntdll files使用 finContours 函数和下载 ntdll 文件时出错
【发布时间】:2014-05-23 14:10:03
【问题描述】:

我是使用 VS2012 和 openCV 完成我的 FYP 的新手,我必须使用 Contours 检测人体(物体检测)。我已经成功安装了(VS2012 和 openCV),并且一直在做一些基本的图像处理,除了逻辑或句法之外没有任何未知问题,直到我遇到使用我现在被拘留的 findContours 函数。我的问题是:

当我不使用与 Contour 相关的东西时,即 findContours , drawContours,通过评论它,一切都很好,我可以使用轨迹栏来扩大/侵蚀图像,但只要我使用 Contour 相关的东西并按“F5” ,显示检测到的对象周围轮廓的图像与断点一起显示,说 Program.exe 已触发断点,因此我无法进一步使用它。

为方便起见,以下是堆栈跟踪中的列表:

注 1: 我已按照 给出的说明进行操作,但是在通过 Microsoft 符号服务器加载未突出显示的“ntdll.dll 和 msvcr”后,在重新启动 (Cntrl+Shift+F5) 或调试(F5) 时突出显示并再次获得 Un - 高亮表示它丢失了。

注意 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);

}

}

【问题讨论】:

    标签: pbrandoli c++ visual-studio-2012 ntdll


    【解决方案1】:

    我从 VS2012 切换到 VS2010,现在一切正常!我不知道 VS2012 有什么问题,因为 VS2013 也提供 VS2010 的结果,但是要使用 VS2013,你需要 Windows 8 操作系统。因此我回到旧版本,因为我使用的是 Windows 7 操作系统!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多