Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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_contrib/blob/master/modules/xobjdetect/src/acffeature.cpp

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); }