OpenCV 3.0 (contrib) Integral Channel Features
I was happy to see that there is an implementation of the Integral Channel Features + WaldBoost algorithm implemented in OpenCV 3.0. This code is currently in the opencv_contrib repository. Unfortunately I have problems to get it working. When I am trying to train the classifier using the following code it looks like something is happening because I see "1/3 - 2/3 ..." as progress indicator in the console. However the function crashes with the following error message:
OpenCV Error: Assertion failed (count > 0) in generateFeatures, file /Users/Development/libraries/opencv_contrib/modules/xobjdetect/src/acffeature.cpp, line 237 libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /Users/Development/libraries/opencv_contrib/modules/xobjdetect/src/acffeature.cpp:237: error: (-215) count > 0 in function generateFeatures
This assertion is made in this file: https://github.com/Itseez/opencv_cont...
I was wondering whether this ICF implementation is usable or very unstable pre-alpha code? Maybe someone can shine some like upon this or hint me into the direction of why the training does not work.
void ChannelFeaturesDetector::trainDetector(string objectDirectory, string backgroundDirectory) {
vector<cv::String> objectFilenames;
objectFilenames.push_back(cv::String("/Users/Development/data/KITTI_benchmark/car_rear_100x80/Car_000000.png"));
objectFilenames.push_back(cv::String("/Users/Development/data/KITTI_benchmark/car_rear_100x80/Car_000005.png"));
objectFilenames.push_back(cv::String("/Users/Development/data/KITTI_benchmark/car_rear_100x80/Car_000010.png"));
vector<cv::String> backgroundFilenames;
backgroundFilenames.push_back(cv::String("/Users/Development/data/KITTI_benchmark/negatives_100x80/000000.png"));
backgroundFilenames.push_back(cv::String("/Users/Development/data/KITTI_benchmark/negatives_100x80/000001.png"));
backgroundFilenames.push_back(cv::String("/Users/Development/data/KITTI_benchmark/negatives_100x80/000002.png"));
// Parameters for ICF training
ICFDetectorParams params;
params.model_n_rows = 56;
params.model_n_cols = 56;
params.is_grayscale = false;
ICFDetector detector;
detector.train(objectFilenames, backgroundFilenames, params); }
can you try to set more of the params ?
the default settings are broken, ie, int feature_count is set to (UINT_MAX), which results in -1 (that's your negative count there, so please set this explicitly, like it was done in the adas examples)
Thanks, you are right. The default parameters are incorrect. Settings all of them manually works indeed.
there are some more pitfalls, i guess.
there might be only less than a dozen folks in this world, who tried to use this so far, so, please report back anything
(also, i'm very curious about your experience with it ;)
Well, I think the documentation is very limited at this point. Some examples:
I will report back if I have some results out of the classifier.