Ask Your Question
0

Integral Channel Features or ICFDetector

asked 2015-03-19 22:08:07 -0600

updated 2015-03-20 04:55:45 -0600

Hi,i got problems when i'm training ICFDetector too. I debuged to find that it will say :

Opencv error:Assertion failed ((unsigned)i < (unsigned)cn) in cv::Vec<float,6>::operator []

when running to

void computeChannels(InputArray image, vector<Mat>& channels)

 Mat_<Vec6f> hist = Mat_<Vec6f>::zeros(grad.rows, grad.cols);
//const float to_deg = 180 / 3.1415926f;
for (int row = 0; row < grad.rows; ++row) {
    for (int col = 0; col < grad.cols; ++col) {
        //float angle = atan2(row_der(row, col), col_der(row, col)) * to_deg;
        float angle = angles(row, col);
        if (angle < 0)
            angle += 180;
        int ind = (int)(angle / 30);

        // If angle == 180, prevent index overflow
        if (ind == 6)
            ind = 5;

        hist(row, col)[ind] = grad(row, col) * 255;
    }
}

i have set the params ,dont know why it happened; and here is my code

ICFDetectorParams params;
params.feature_count = 2000;  // parser.get<int>("feature_count");42000
params.weak_count    = 100;    // parser.get<int>("weak_count"); 200
params.bg_per_image  = 5;     // parser.get<int>("bg_per_image");
params.model_n_rows  = 128;
params.model_n_cols  = 64;
params.features_type = "icf";
params.alpha         = 0.15f; // default: 0.02


icf.train(pos_fileNames,bg_fileNames,params);

Can u tell me any problems?

edit retag flag offensive close merge delete

Comments

1

The ICF detector is in the contrib repository with a good reason. It is broken, slow and it has a terrible accuracy for the moment. What I am guessing that is happening is that either your channel matrix or your input image is invalid. Can you check this?

StevenPuttemans gravatar imageStevenPuttemans ( 2015-03-20 04:57:23 -0600 )edit

it looks like this issue to me.

also see here please

berak gravatar imageberak ( 2015-03-20 08:27:30 -0600 )edit

I commented the loop code , it can run correctly .But i know it's not my want . So my input image is vaild.And I dont know how to check channel matrix ,sorry about that.

l6128589 gravatar imagel6128589 ( 2015-03-25 00:38:00 -0600 )edit
1

I found the reason.Because cartToPolar(col_der, row_der, grad, angles, true) , the angles will range from 0 to 360 ; So when "float angle = angles(row, col); int ind = (int)(angle / 30);" "ind" can be larger than 5 ,but the number of the channel is 6 .That is the reason .

I change if (angle < 0) angle += 180; to if (angle >180) angle -= 180; And it works !

l6128589 gravatar imagel6128589 ( 2015-03-25 10:38:44 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-08-04 08:02:03 -0600

New set of problem- plz see here.. http://answers.opencv.org/question/67...

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-03-19 21:54:21 -0600

Seen: 988 times

Last updated: Mar 20 '15