I am using Qt-Creator 5.2.0 to create a GUI to display the Image and a binary classifier to detect the object is present or absent using Dalal & triggs HOG extraction algorithm.

I am facing the mentioned Run time error & need help to solve this issue.
QT_ERROR.jpg

mainwindow.h

Qt Code:
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3.  
  4. #include <QMainWindow>
  5. #include<QDebug>
  6. #include <opencv2/calib3d/calib3d.hpp>
  7. //#include <opencv2/calib3d/calib3d.hpp>
  8. #include<opencv2/core/core.hpp>
  9. #include<opencv2/features2d/features2d.hpp>
  10. #include<opencv2/highgui/highgui.hpp>
  11. #include<opencv2/imgproc/imgproc.hpp>
  12. #include<opencv2/ml/ml.hpp>
  13. #include<opencv2/objdetect/objdetect.hpp>
  14. using namespace cv;
  15.  
  16. namespace Ui {
  17. class MainWindow;
  18. }
  19.  
  20. class MainWindow : public QMainWindow
  21. {
  22. Q_OBJECT
  23.  
  24. public:
  25. explicit MainWindow(QWidget *parent = 0);
  26. ~MainWindow();
  27.  
  28. private:
  29. Ui::MainWindow *ui;
  30. };
  31. float SVM_classifier(Mat image);
  32.  
  33.  
  34. #endif // MAINWINDOW_H
To copy to clipboard, switch view to plain text mode 

mainwindow.cpp

Qt Code:
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3.  
  4. MainWindow::MainWindow(QWidget *parent) :
  5. QMainWindow(parent),
  6. ui(new Ui::MainWindow)
  7. {
  8. ui->setupUi(this);
  9.  
  10. IplImage *oMatDeltaImage = cvLoadImage("E:\\Wihart\\Car_Images\\(785).jpg",CV_LOAD_IMAGE_UNCHANGED);
  11.  
  12. Mat mat_img(oMatDeltaImage );
  13. float oMatResult = SVM_classifier(mat_img);
  14. // qDebug()<<oMatResult;
  15.  
  16. }
  17.  
  18. MainWindow::~MainWindow()
  19. {
  20. delete ui;
  21. }
  22.  
  23. float SVM_classifier(Mat image)
  24. {
  25.  
  26. resize(image, image, Size(64,128) );
  27.  
  28. HOGDescriptor extract_features;
  29. vector<float> descriptorsValues;
  30. descriptorsValues.resize(0.0);
  31. vector<Point> locations;
  32. locations.resize(0.0);
  33. extract_features.compute( image, descriptorsValues, Size(0,0), Size(0,0), locations);
  34.  
  35. Mat feature_vector(descriptorsValues);// = Mat::zeros((descriptorsValues.size(),1));
  36. CvSVM SVM;
  37. SVM.load("SVM_classifier_data.xml");
  38. float result= SVM.predict(feature_vector);
  39. return result;
  40. }
To copy to clipboard, switch view to plain text mode 

main.cpp
Qt Code:
  1. #include "mainwindow.h"
  2. #include <QApplication>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. QApplication a(argc, argv);
  7. MainWindow w;
  8. w.show();
  9.  
  10. return a.exec();
  11. }
To copy to clipboard, switch view to plain text mode