Skip to content
Snippets Groups Projects
Commit 9e012a2d authored by Julien Michel's avatar Julien Michel
Browse files

ENH: Avoid possible division by zero

parent 584a1d9e
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,12 @@ public:
const cv::Mat& missing =
cv::Mat()) const
{
// Sanity check (division by ntrees later on)
if(ntrees == 0)
{
return 0.;
}
std::vector<unsigned int> classVotes(nclasses);
for( int k = 0; k < ntrees; k++ )
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment