Commit 6b46b3215a436984d80366acfc4a02b8f48527c4
1 parent
ecc07066
StageIndex bug fix
Showing
1 changed file
with
1 additions
and
1 deletions
openbr/plugins/classification/cascade.cpp
| @@ -238,7 +238,7 @@ class CascadeClassifier : public Classifier | @@ -238,7 +238,7 @@ class CascadeClassifier : public Classifier | ||
| 238 | const int stopStage = maxStage == -1 ? numStages : maxStage; | 238 | const int stopStage = maxStage == -1 ? numStages : maxStage; |
| 239 | int stageIndex = 0; | 239 | int stageIndex = 0; |
| 240 | foreach (const Classifier *stage, stages) { | 240 | foreach (const Classifier *stage, stages) { |
| 241 | - if (stageIndex == stopStage) | 241 | + if (stageIndex++ == stopStage) |
| 242 | break; | 242 | break; |
| 243 | float result = stage->classify(src, process, &stageConf); | 243 | float result = stage->classify(src, process, &stageConf); |
| 244 | if (confidence) | 244 | if (confidence) |