Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

what is OpenCV 3.2 machine learning implementation status?

I am trying to upgrade OpenCV libraries on our software from 2.4 to 3.2, but from what I have encountered up until now it seems it's still under heavy development.

With decision trees I straight away got a crash as member cv_labels vector of DTreesImpl class was not initialized, but in calculation it is used as initialized. I used a solution proposed in this comment to proceed further:

(should be a link to github issue, but my karma does not allow to share links :))

void DTreesImpl::startTraining( const Ptr<TrainData>& data, int )
{

...

    else
        data->getResponses().copyTo(w->ord_responses);

    // ---- new code ----
    const int n_cv = params.getCVFolds();
    if ( n_cv > 0 ) {
        int nsamples = (int) w->cat_responses.size();
        w->cv_labels.resize( nsamples );
        randu( w->cv_labels, 0, n_cv );
    }
}

Then I noticed that different decision tree is being generated than what used to be. Tracking it down I noticed that current implementation does not prune trees at all:

int maxdepth = INT_MAX;//pruneCV(root);

Parameter set by setTruncatePrunedTree is not used as well.

Besides I find some node information being hidden from public access in the API but this is minor.

Now I haven't gone too deep further and I haven't tried looking into implementation of other statistical models if there are similar problems, but my question is: Does anybody know what actual state is with machine learning module? Is it still experimental? Is anybody working on it at the moment, because this crash problem exists already 2 years and was not fixed with latest OpenCV release?

what is OpenCV 3.2 machine learning implementation status?

I am trying to upgrade OpenCV libraries on our software from 2.4 to 3.2, but from what I have encountered up until now it seems it's still under heavy development.

With decision trees I straight away got a crash as member cv_labels vector of DTreesImpl class was not initialized, but in calculation it is used as initialized. I used a solution proposed in this comment to proceed further:

(should be a link to github issue, but my karma does not allow to share links :))https://github.com/opencv/opencv/issues/5070#issuecomment-143835291

void DTreesImpl::startTraining( const Ptr<TrainData>& data, int )
{

...

    else
        data->getResponses().copyTo(w->ord_responses);

    // ---- new code ----
    const int n_cv = params.getCVFolds();
    if ( n_cv > 0 ) {
        int nsamples = (int) w->cat_responses.size();
        w->cv_labels.resize( nsamples );
        randu( w->cv_labels, 0, n_cv );
    }
}

Then I noticed that different decision tree is being generated than what used to be. Tracking it down I noticed that current implementation does not prune trees at all:

int maxdepth = INT_MAX;//pruneCV(root);

Parameter set by setTruncatePrunedTree is not used as well.

Besides I find some node information being hidden from public access in the API but this is minor.

Now I haven't gone too deep further and I haven't tried looking into implementation of other statistical models if there are similar problems, but my question is: Does anybody know what actual state is with machine learning module? Is it still experimental? Is anybody working on it at the moment, because this crash problem exists already 2 years and was not fixed with latest OpenCV release?