EDN Admin
Well-known member
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 pencv2.2includeopencv2flannlogger.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 crogram filesmicrosoft visual studio 10.0vcincludestdio.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:UsersAdministratorDocumentsVisual Studio 2010Projects7Debug7.exe, Symbols loaded.
7.exe: Loaded C:WindowsSystem32ntdll.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32kernel32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32KernelBase.dll, Cannot find or open the PDB file
7.exe: Loaded C:OpenCV2.2binopencv_core220.dll, Binary was not built with debug information.
7.exe: Loaded C:WindowsSystem32msvcp100.dll, Symbols loaded.
7.exe: Loaded C:WindowsSystem32msvcr100.dll, Symbols loaded.
7.exe: Loaded C:OpenCV2.2binopencv_highgui220.dll, Binary was not built with debug information.
7.exe: Loaded C:WindowsSystem32user32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32gdi32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32lpk.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32usp10.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32msvcrt.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32ole32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32rpcrt4.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32advapi32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32sechost.dll, Cannot find or open the PDB file
7.exe: Loaded C:Windowswinsxsx86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149afcomctl32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32avifil32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32winmm.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32msacm32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32msvfw32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32shell32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32shlwapi.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32avicap32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32version.dll, Cannot find or open the PDB file
7.exe: Loaded C:OpenCV2.2binopencv_imgproc220.dll, Binary was not built with debug information.
7.exe: Loaded C:OpenCV2.2binopencv_objdetect220.dll, Binary was not built with debug information.
7.exe: Loaded C:WindowsSystem32msvcp100d.dll, Symbols loaded.
7.exe: Loaded C:WindowsSystem32msvcr100d.dll, Symbols loaded.
7.exe: Loaded C:WindowsSystem32imm32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32msctf.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 <opencv2highguihighgui.hpp>
#include <opencv2opencv.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:EFAULT_NLEVELS);
cpu_hog.setSVMDetector(detector);
while(true)
{
VideoCapture vc;
Mat frame;
vc.open("kl.avi");
if (!vc.isOpened()) cout << "cant 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;
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
View the full article
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 pencv2.2includeopencv2flannlogger.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 crogram filesmicrosoft visual studio 10.0vcincludestdio.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:UsersAdministratorDocumentsVisual Studio 2010Projects7Debug7.exe, Symbols loaded.
7.exe: Loaded C:WindowsSystem32ntdll.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32kernel32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32KernelBase.dll, Cannot find or open the PDB file
7.exe: Loaded C:OpenCV2.2binopencv_core220.dll, Binary was not built with debug information.
7.exe: Loaded C:WindowsSystem32msvcp100.dll, Symbols loaded.
7.exe: Loaded C:WindowsSystem32msvcr100.dll, Symbols loaded.
7.exe: Loaded C:OpenCV2.2binopencv_highgui220.dll, Binary was not built with debug information.
7.exe: Loaded C:WindowsSystem32user32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32gdi32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32lpk.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32usp10.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32msvcrt.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32ole32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32rpcrt4.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32advapi32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32sechost.dll, Cannot find or open the PDB file
7.exe: Loaded C:Windowswinsxsx86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149afcomctl32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32avifil32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32winmm.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32msacm32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32msvfw32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32shell32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32shlwapi.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32avicap32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32version.dll, Cannot find or open the PDB file
7.exe: Loaded C:OpenCV2.2binopencv_imgproc220.dll, Binary was not built with debug information.
7.exe: Loaded C:OpenCV2.2binopencv_objdetect220.dll, Binary was not built with debug information.
7.exe: Loaded C:WindowsSystem32msvcp100d.dll, Symbols loaded.
7.exe: Loaded C:WindowsSystem32msvcr100d.dll, Symbols loaded.
7.exe: Loaded C:WindowsSystem32imm32.dll, Cannot find or open the PDB file
7.exe: Loaded C:WindowsSystem32msctf.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 <opencv2highguihighgui.hpp>
#include <opencv2opencv.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:EFAULT_NLEVELS);
cpu_hog.setSVMDetector(detector);
while(true)
{
VideoCapture vc;
Mat frame;
vc.open("kl.avi");
if (!vc.isOpened()) cout << "cant 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;
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
View the full article