none
Unable to Debug an OpenCV code, Error msg "Cannot find or open the PDB File

    Question

  • hi

    i am working on a project which tracks objects in a video. i am using visual studio c++ 2010 express and open cv 2.2.

    i installed and configured opencv without using cmake .

    i have successfully compiled and build the soln( only a single warning :\opencv2.2\include\opencv2\flann\logger.h(66): warning C4996: 'fopen': This function or variable may be unsafe  Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS ) and c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen'.

    when i try to debug it a pop up window appears for a fraction of a second and then displays the below message in the output window.

    '7.exe': Loaded 'C:\Users\Administrator\Documents\Visual Studio 2010\Projects\7\Debug\7.exe', Symbols loaded.
    '7.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\OpenCV2.2\bin\opencv_core220.dll', Binary was not built with debug information.
    '7.exe': Loaded 'C:\Windows\System32\msvcp100.dll', Symbols loaded.
    '7.exe': Loaded 'C:\Windows\System32\msvcr100.dll', Symbols loaded.
    '7.exe': Loaded 'C:\OpenCV2.2\bin\opencv_highgui220.dll', Binary was not built with debug information.
    '7.exe': Loaded 'C:\Windows\System32\user32.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\gdi32.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\lpk.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\usp10.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\msvcrt.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\ole32.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\rpcrt4.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\advapi32.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\sechost.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\avifil32.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\winmm.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\msacm32.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\msvfw32.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\shell32.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\shlwapi.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\avicap32.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\version.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\OpenCV2.2\bin\opencv_imgproc220.dll', Binary was not built with debug information.
    '7.exe': Loaded 'C:\OpenCV2.2\bin\opencv_objdetect220.dll', Binary was not built with debug information.
    '7.exe': Loaded 'C:\Windows\System32\msvcp100d.dll', Symbols loaded.
    '7.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.
    '7.exe': Loaded 'C:\Windows\System32\imm32.dll', Cannot find or open the PDB file
    '7.exe': Loaded 'C:\Windows\System32\msctf.dll', Cannot find or open the PDB file
    First-chance exception at 0x77012d37 in 7.exe: 0xC0000005: Access violation reading location 0x4c80a172.
    Unhandled exception at 0x77012d37 in 7.exe: 0xC0000005: Access violation reading location 0x4c80a172.


    here is the code:

    #include <iostream>
    #include <fstream>
    #include <string>
    #include <sstream>
    #include <iomanip>
    #include <stdexcept>
    #include <opencv2\highgui\highgui.hpp>
    #include <opencv2\opencv.hpp>

    using namespace std;
    using namespace cv;

    int main()
    {

    bool write_video = false;
        double dst_video_fps = 24.;

        bool make_gray = false;

        bool resize_src = false;
        int width = 640;
        int height = 480;

        double scale = 1.05;
        int nlevels = 13;
        int gr_threshold = 8;
        double hit_threshold = 1.4;
        bool hit_threshold_auto = true;

        int win_width = 48;
        int win_stride_width = 8;
        int win_stride_height = 8;

        bool gamma_corr = true;
    bool use_gpu = false;


    cout << "Resized source: (" << width << ", " << height << ")\n";
        cout << "Group threshold: " << gr_threshold << endl;
        cout << "Levels number: " << nlevels << endl;
        cout << "Win width: " << win_width << endl;
        cout << "Win stride: (" << win_stride_width << ", " << win_stride_height << ")\n";
        cout << "Hit threshold: " << hit_threshold << endl;
        cout << "Gamma correction: " << gamma_corr << endl;
        cout << endl;

    Size win_size(win_width, win_width * 2); //(64, 128) or (48, 96)
        Size win_stride(win_stride_width, win_stride_height);

    // Create HOG descriptors and detectors here
        vector<float> detector;
    cv::HOGDescriptor cpu_hog(win_size, Size(16, 16), Size(8, 8),Size(8, 8), 9, 1, -1,HOGDescriptor::L2Hys, 0.2, gamma_corr, cv::HOGDescriptor::DEFAULT_NLEVELS);
    cpu_hog.setSVMDetector(detector);

    while(true)
    {

    VideoCapture vc;
        Mat frame;

    vc.open("kl.avi");
    if (!vc.isOpened()) cout << "can't open video file: kl.avi" << endl;

    Mat img_aux, img, img_to_show;

    while(true)
    {
    vc >> frame;
            if (frame.empty())
                continue;

    if (make_gray) cvtColor(frame, img_aux, CV_BGR2GRAY);
    else frame.copyTo(img_aux);

    // Resize image
            //if (resize_src) resize(img_aux, img, Size(width, height));
            /*else*/ img = img_aux;
            img_to_show = img;

    cpu_hog.nlevels = nlevels;

    vector<Rect> found;
    cpu_hog.detectMultiScale(img, found, hit_threshold, win_stride,Size(0, 0), scale, gr_threshold);

    // Draw positive classified windows
            for (size_t i = 0; i < found.size(); i++)
            {
                Rect r = found[i];
                rectangle(img_to_show, r.tl(), r.br(), CV_RGB(0, 255, 0), 3);
            }

    imshow("opencv_gpu_hog", img_to_show);
    }
    if (waitKey(10)>=0)
                break;
    }
    return 0;
    }

    Kindly give a soln.

    Best Regards,

    Manish


    Thursday, February 28, 2013 2:44 AM

All replies

  • The messages about missing PDB files are of no importance. If you run a debug configuration build in the debugger it should stop execution at the access violation. At that point use the debugger stack window to find out where in the code it came up with the invalid address. It will show you where in your code the address was used, and show which variable contains the invalid address.

     

    Thursday, February 28, 2013 4:20 AM
  • Hello,

    For issues about debugging OpenCV code, you may go to this forum for help: http://answers.opencv.org/questions/

    This thread will be moved to Off-topic. Thanks for your understanding.

    Thanks,


    Damon Zheng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, March 06, 2013 6:34 AM