0

I have this code that compiled perfectly, but had to format my machine and now it will not compile, a window pops up "The application failed to initialize properly (0xc0150002). Click OK to close the application."

Does anyone know how to solve this problem?

Below the code and log visual studio. I am using visual studio express 2010, windows 8.

Code:

#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>

using namespace cv;

int main ( int argc, char **argv )
{
Mat im_gray;
Mat img_bw;
Mat img_final;

Mat im_rgb  = imread("img.jpg");
cvtColor(im_rgb,im_gray,CV_RGB2GRAY);


adaptiveThreshold(im_gray, img_bw, 255, ADAPTIVE_THRESH_MEAN_C, THRESH_BINARY_INV, 105, 1);


dilate(img_bw, img_final, Mat(), Point(-1, -1), 5, 1, 1);

imwrite("img_final.jpg", img_final);

return 0;

}

Output:

'opencv.exe': Loaded 'C:\Users\Anne\Documents\opencv\Debug\opencv.exe', Symbols loaded.
'opencv.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Users\Anne\Documents\opencv\opencv\opencv_core230d.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Users\Anne\Documents\opencv\opencv\opencv_highgui230d.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Users\Anne\Documents\opencv\opencv\opencv_imgproc230d.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\System32\msvcp100d.dll', Symbols loaded.
'opencv.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.
'opencv.exe': Loaded 'C:\Windows\System32\user32.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\System32\gdi32.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\System32\ole32.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\System32\oleaut32.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\System32\advapi32.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.9200.16658_none_bf1359a245f1cd12\comctl32.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\System32\avifil32.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\System32\msvfw32.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\System32\avicap32.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\OpenCV2.3\build\x86\vc9\bin\tbb_debug.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\System32\combase.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\System32\msvcrt.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\System32\rpcrt4.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\System32\sechost.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\System32\winmm.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\System32\msacm32.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\System32\shell32.dll', Cannot find or open the PDB file
'opencv.exe': Loaded 'C:\Windows\System32\version.dll', Cannot find or open the PDB file
The program '[2112] opencv.exe: Native' has exited with code -1072365566 (0xc0150002).

Update:

I followed this and solved my problem. Now everything is working normally. Thank you all for the help. http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html#windowssetpathandenviromentvariable

U23r
  • 1,653
  • 10
  • 28
  • 44
  • 1
    maybe this theme will help you: http://stackoverflow.com/questions/12954821/cannot-find-or-open-the-pdb-file-in-visual-studio-c-2010 – Dlash Nov 21 '13 at 05:17
  • I tried the solution from this link but the error continues. @user2644984 – U23r Nov 21 '13 at 12:37

1 Answers1

1

I've test this code (your code with minor edition) and it works fine:

#include <opencv2/opencv.hpp>
using namespace cv;
int main ( int argc, char **argv )
{
    Mat im_gray;
    Mat img_bw;
    Mat img_final;
    Mat im_rgb  = imread("D:\\ImagesForTest\\lena.jpg");
    cvtColor(im_rgb,im_gray,cv::COLOR_RGB2GRAY);
    adaptiveThreshold(im_gray, img_bw, 255, ADAPTIVE_THRESH_MEAN_C, THRESH_BINARY_INV, 105, 1);
    dilate(img_bw, img_final, Mat(), Point(-1, -1), 5, 1, 1);
    imwrite("img_final.jpg", img_final);
    return 0;
}
Andrey Smorodov
  • 10,649
  • 2
  • 35
  • 42
  • I checked all the paths / folders of the dlls it says not to find but they are all there. Where do I add? – U23r Nov 21 '13 at 12:41
  • 1
    Sorry, I've not notice opencv's dll's in list above. They loaden normally. Just need pdb files. – Andrey Smorodov Nov 21 '13 at 16:53
  • I've corrected my answer. Try set absolute image path. And set working directory in project properties to exe path. Project Properties -> Configuration Properties -> debugging -> Working Directory. – Andrey Smorodov Nov 21 '13 at 17:01