NormalBayesClassifier (Bug #4429)


Added by Oliver Naumann over 9 years ago. Updated over 9 years ago.


Status:Done Start date:2015-06-23
Priority:High Due date:
Assignee:- % Done:

0%

Category:ml
Target version:3.1
Affected version:branch 'master' (3.0-dev) Operating System:Any
Difficulty:Easy HW Platform:Any
Pull request:

Description

In: modules/ml/src/nbayes.cpp (Line 316)

Wrong plausibility check leads to a CV_Error.

Should be:

if( samples.rows > 1 && ! _results.needed() )


History

Updated by be rak over 9 years ago

given a Ptr<NormalBayesClassifier> bayes;

if bayes->predict(test) is called with more than one row in test, an exception should be thrown (because no results Mat was supplied for the return value).

due to the error above, this does not happen and the results and probabilities Mat's are not allocated correctly.

for more background see:
http://answers.opencv.org/question/64575/normalbayesclassifier-predict-errors/

https://github.com/Itseez/opencv/pull/4167

Updated by be rak over 9 years ago

https://github.com/Itseez/opencv/pull/4167 got merged, i think, we can close this issue.

Updated by Maksim Shabunin over 9 years ago

Thank you!

  • Target version set to 3.1
  • Status changed from New to Done

Also available in: Atom PDF