I try to calculate Haar feature using opencv (Given an image).
Input: an image
output: haar feature
For that, I am using the FeatureEvaluator from OpenCV.
But I got an exception when I try to calculate one feature. Here is how I am doing:
Ptr<FeatureEvaluator> ptrHaar = FeatureEvaluator::create(FeatureEvaluator::HAAR);
Mat img = imread(image_path); // image of size 2048*1536 correctly loaded
ptrHaar->setImage(img, Size(100, 100));
ptrHaar->setWindow(Point(0, 0));
double res = ptrHaar->calcOrd(0); // get the exception here