I have been trying to load and display an image following the opencv tutorial but i keep getting "C:\OpenCV\build\x64\vc10\bin\opencv_core243d.dll', Cannot find or open the PDB file". I am using Microsoft visual Studio 2010 Professional. I have followed the setup tutorial on this link: http://docs.opencv.org/opencv_tutorials.pdf to the letter. I first started by using the prebuilt library and by building my own library as described with the same end results. i have restored my pc to factory settings twice just to get this to work
this is the code:
// Video Image PSNR and SSIM
include <iostream> // for standard I/O
include <string> // for strings
include <iomanip> // for controlling float print precision
include <sstream> // string to number conversion
include <opencv2 imgproc="" imgproc.hpp=""> // Gaussian Blur
include <opencv2 core="" core.hpp=""> // Basic OpenCV structures (cv::Mat, Scalar)
include <opencv2 highgui="" highgui.hpp=""> // OpenCV window I/O
using namespace std; using namespace cv;
double getPSNR ( const Mat& I1, const Mat& I2); Scalar getMSSIM( const Mat& I1, const Mat& I2);
static void help() { cout << "\n--------------------------------------------------------------------------" << endl << "This program shows how to read a video file with OpenCV. In addition, it tests the" << " similarity of two input videos first with PSNR, and for the frames below a PSNR " << endl << "trigger value, also with MSSIM."<< endl << "Usage:" << endl << "./video-source referenceVideo useCaseTestVideo PSNR_Trigger_Value Wait_Between_Frames " << endl << "--------------------------------------------------------------------------" << endl << endl; } int main(int argc, char *argv[]) { help(); if (argc != 5) { cout << "Not enough parameters" << endl; return -1; } stringstream conv;
const string sourceReference = argv[1],sourceCompareWith = argv[2];
int psnrTriggerValue, delay;
conv << argv[3] << argv[4]; // put in the strings
conv >> psnrTriggerValue >> delay;// take out the numbers
char c;
int frameNum = -1; // Frame counter
VideoCapture captRefrnc(sourceReference),
captUndTst(sourceCompareWith);
if ( !captRefrnc.isOpened())
{
cout << "Could not open reference " << sourceReference << endl;
return -1;
}
if( !captUndTst.isOpened())
{
cout << "Could not open case test " << sourceCompareWith << endl;
return -1;
}
Size refS = Size((int) captRefrnc.get(CV_CAP_PROP_FRAME_WIDTH),
(int) captRefrnc.get(CV_CAP_PROP_FRAME_HEIGHT)),
uTSi = Size((int) captUndTst.get(CV_CAP_PROP_FRAME_WIDTH),
(int) captUndTst.get(CV_CAP_PROP_FRAME_HEIGHT));
if (refS != uTSi)
{
cout << "Inputs have different size!!! Closing." << endl;
return -1;
}
const char* WIN_UT = "Under Test";
const char* WIN_RF = "Reference";
// Windows
namedWindow(WIN_RF, CV_WINDOW_AUTOSIZE );
namedWindow(WIN_UT, CV_WINDOW_AUTOSIZE );
cvMoveWindow(WIN_RF, 400 , 0); //750, 2 (bernat =0)
cvMoveWindow(WIN_UT, refS.width, 0); //1500, 2
cout << "Frame resolution: Width=" << refS.width << " Height=" << refS.height
<< " of nr#: " << captRefrnc.get(CV_CAP_PROP_FRAME_COUNT) << endl;
cout << "PSNR trigger value " <<
setiosflags(ios::fixed) << setprecision(3) << psnrTriggerValue << endl;
Mat frameReference, frameUnderTest;
double psnrV;
Scalar mssimV;
for(;;) //Show the image captured in the window and repeat
{
captRefrnc >> frameReference;
captUndTst >> frameUnderTest;
if( frameReference.empty() || frameUnderTest.empty())
{
cout << " < < < Game over! > > > ";
break;
}
++frameNum;
cout <<"Frame:" << frameNum;
///////////////////////////////// PSNR ////////////////////////////////////////////////////
psnrV = getPSNR(frameReference,frameUnderTest); //get PSNR
cout << setiosflags(ios::fixed) << setprecision(3) << psnrV << "dB";
//////////////////////////////////// MSSIM /////////////////////////////////////////////////
if (psnrV < psnrTriggerValue)
{
mssimV = getMSSIM(frameReference,frameUnderTest);
cout << " MSSIM: "
<< "R" << setiosflags(ios::fixed) << setprecision(3) << mssimV.val[2] * 100
<< "G" << setiosflags(ios::fixed) << setprecision(3) << mssimV.val[1] * 100
<< "B" << setiosflags(ios::fixed) << setprecision(3) << mssimV.val[0] * 100;
}
cout << endl;
////////////////////////////////// Show Image /////////////////////////////////////////////
imshow( WIN_RF, frameReference);
imshow( WIN_UT, frameUnderTest);
c = (char)cvWaitKey(delay);
if (c == 27) break;
}
return 0;
}
double getPSNR(const Mat& I1, const Mat& I2) { Mat s1; absdiff(I1, I2, s1); // |I1 - I2| s1.convertTo(s1, CV_32F); // cannot make a square on 8 bits s1 = s1.mul(s1); // |I1 - I2|^2
Scalar s = sum(s1); // sum elements per channel
double sse = s.val[0] + s.val[1] + s.val[2]; // sum channels
if( sse <= 1e-10) // for small values return zero
return 0;
else
{
double mse =sse /(double)(I1.channels() * I1.total());
double psnr = 10.0*log10((255*255)/mse);
return psnr;
}
}
Scalar getMSSIM( const Mat& i1, const Mat& i2) { const double C1 = 6.5025, C2 = 58.5225; /******** INITS ***********/ int d = CV_32F;
Mat I1, I2;
i1.convertTo(I1, d); // cannot calculate on one byte large values
i2.convertTo(I2, d);
Mat I2_2 = I2.mul(I2); // I2^2
Mat I1_2 = I1.mul(I1); // I1^2
Mat I1_I2 = I1.mul(I2); // I1 * I2
/*************************** END INITS **********************************/
Mat mu1, mu2; // PRELIMINARY COMPUTING
GaussianBlur(I1, mu1, Size(11, 11), 1.5);
GaussianBlur(I2, mu2, Size(11, 11), 1.5);
Mat mu1_2 = mu1.mul(mu1);
Mat mu2_2 = mu2.mul(mu2);
Mat mu1_mu2 = mu1.mul(mu2);
Mat sigma1_2, sigma2_2, sigma12;
GaussianBlur(I1_2, sigma1_2, Size(11, 11), 1.5);
sigma1_2 -= mu1_2;
GaussianBlur(I2_2, sigma2_2, Size(11, 11), 1.5);
sigma2_2 -= mu2_2;
GaussianBlur(I1_I2, sigma12, Size(11, 11), 1.5);
sigma12 -= mu1_mu2;
///////////////////////////////// FORMULA ////////////////////////////////
Mat t1, t2, t3;
t1 = 2 * mu1_mu2 + C1;
t2 = 2 * sigma12 + C2;
t3 = t1.mul(t2); // t3 = ((2*mu1_mu2 + C1).*(2*sigma12 + C2))
t1 = mu1_2 + mu2_2 + C1;
t2 = sigma1_2 + sigma2_2 + C2;
t1 = t1.mul(t2); // t1 =((mu1_2 + mu2_2 + C1).*(sigma1_2 + sigma2_2 + C2))
Mat ssim_map;
divide(t3, t1, ssim_map); // ssim_map = t3./t1;
Scalar mssim = mean( ssim_map ); // mssim = average of ssim map
return mssim;
}
and this is the debug report:
'OpenCV_Test.exe': Loaded 'C:\Users\Ritchie\Documents\Visual Studio 2010\Projects\OpenCV_Test\x64\Debug\OpenCV_Test.exe', Symbols loaded. 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\ntdll.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\kernel32.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\OpenCV\build\x64\vc10\bin\opencv_core243d.dll', Cannot find or open the PDB file 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\msvcp100d.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\OpenCV\build\x64\vc10\bin\opencv_imgproc243d.dll', Cannot find or open the PDB file 'OpenCV_Test.exe': Loaded 'C:\OpenCV\build\x64\vc10\bin\opencv_highgui243d.dll', Cannot find or open the PDB file 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\user32.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\gdi32.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\lpk.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\usp10.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\msvcrt.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\ole32.dll', Symbols loaded. 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\rpcrt4.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\oleaut32.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\advapi32.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\sechost.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\winsxs\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_a4d6a923711520a9\comctl32.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\avifil32.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\winmm.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\msacm32.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\msvfw32.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\shell32.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\shlwapi.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\avicap32.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\version.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\imm32.dll', Symbols loaded (source information stripped). 'OpenCV_Test.exe': Loaded 'C:\Windows\System32\msctf.dll', Symbols loaded (source information stripped). The program '[3280] OpenCV_Test.exe: Native' has exited with code -1 (0xffffffff).
as can be seen, i am using windows 7 64 bit so I changed the configuration manager to x64 through project properties, new configuration, x64, ok. In my system's enviroment Variable I made these entries first from command prompt:setx -m OPENCV_DIR C:\OpenCV\build and added this to the system Path: %OPENCV_DIR%\x64\vc10\bin; I even added %OPENCV_DIR%\x86\vc10\bin; just in case
In Visual Studio, in the property manager, I added the folder links to the project properties as described. under C/C++, additional include directory, then added: $(OPENCV_DIR)\include, in the Linker, Additional Library Directory, i added; $(OPENCV_DIR)\x64\vc10\lib; the same way i included the x86 link later just incase. i set Enable incremental Linking to: No (/INCREMENTAL:NO). Linker, Input, additional dependancies, i added: opencv_core243d.lib opencv_imgproc243d.lib opencv_highgui243d.lib opencv_ml243d.lib opencv_video243d.lib opencv_features2d243d.lib opencv_calib3d243d.lib opencv_objdetect243d.lib opencv_contrib243d.lib opencv_legacy243d.lib opencv_flann243d.lib opencv_gpu243d.lib opencv_nonfree243d.lib opencv_photo243d.lib opencv_stitching243d.lib opencv_ts243d.lib opencv_videostab243d.lib
in the Debug menu, options, General, I enabled "Sorce Server Support" and under Symbols, I enabled "Microsoft Symbol Servers. I have tried with both options for Automatically Load Symbols for:, but i am still having the same problems.
I really need your help as i have tried everything possible. Thanks in advance