return bb != b.bb || channel != b.channel;
}
+
+ float operator() (const Mat& integrals, const cv::Size& model) const
+ {
+ const int* ptr = integrals.ptr<int>(0) + (model.height * channel + bb.y) * model.width + bb.x;
+
+ int a = ptr[0];
+ int b = ptr[bb.width];
+
+ ptr += bb.height * model.width;
+
+ int c = ptr[bb.width];
+ int d = ptr[0];
+
+ return (float)(a - b + c - d);
+ }
+
private:
cv::Rect bb;
int channel;
}
std::cout << "WARNING: " << sampleIdx << std::endl;
+ std::cout << "WARNING: " << trainData << std::endl;
+ std::cout << "WARNING: " << _responses << std::endl;
+ std::cout << "WARNING: " << varIdx << std::endl;
+ std::cout << "WARNING: " << varType << std::endl;
bool update = false;
return cv::Boost::train(trainData, CV_COL_SAMPLE, _responses, varIdx, sampleIdx, varType, missingDataMask, _params,
float sft::FeaturePool::apply(int fi, int si, const Mat& integrals) const
{
- return 0.f;
+ return pool[fi](integrals.row(si), model);
}
int shrinkage = cfg.shrinkage;
int octave = *it;
- cv::Size model = cfg.modelWinSize;
+ cv::Size model = cv::Size(cfg.modelWinSize.width / cfg.shrinkage, cfg.modelWinSize.height / cfg.shrinkage );
std::string path = cfg.trainPath;
cv::Rect boundingBox(cfg.offset.x / cfg.shrinkage, cfg.offset.y / cfg.shrinkage,