Raspberry Pi Segmentation Fault Caused by detectMultiScale
I have some code tested and working on my Linux Mint desktop which fails when ran on my RPi type B. Specifically, it is the line:
hog.detectMultiScale(img[i],people,0,Size(4,4),Size(0,0));
That is causing a segmentation fault, the code runs fine when it is removed (although obviously this renders the app useless).
What could be causing this? Is it the memory limitation of the Pi? I've tried running it with very small images, to no avail.
Any help appreciated
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <string>
#include <iostream>
#include <iomanip>
#include <math.h>
using namespace cv;
using namespace std;
#define OUTPUTDETECTIONS
int main( int argc, char ** argv )
{
string aFirstFile = std::string(argv[1]);
cout << "Test CVHumanTrigger" << aFirstFile << endl;
Mat img[1];
img[0] = imread(aFirstFile);
cv::HOGDescriptor hog;
vector<cv::Rect> people;
hog.setSVMDetector(hog.getDefaultPeopleDetector());
hog.detectMultiScale(img[0],people,0,Size(256,256),Size(0,0));
cout <<"end test" << endl;
return 0;
}