From fca37f5a9c1b281114e2b9c50a2f22c19c12afdc Mon Sep 17 00:00:00 2001 From: Cloud User Date: Fri, 13 Mar 2020 13:27:48 +0100 Subject: [PATCH 1/2] small fix to make this work with opencv-3.4.1 under centos8 newest ubuntu version is 3.2 which still seems to work --- src/aux-level/train-aux.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/aux-level/train-aux.cpp b/src/aux-level/train-aux.cpp index e2a8426c..c1f74925 100755 --- a/src/aux-level/train-aux.cpp +++ b/src/aux-level/train-aux.cpp @@ -44,7 +44,8 @@ Ptr train_svm(Ptr TrainData, par_train_t *train, FILE *fp) svm->setType(SVM::C_SVC); } else { printf("unknown SVM method\n"); - return NULL; + Ptr r; + return r; } svm->setKernel(SVM::RBF); From ac32a33dd0cf6b661464379a9af6923368b4cc70 Mon Sep 17 00:00:00 2001 From: David Frantz <32633788+davidfrantz@users.noreply.github.com> Date: Wed, 24 Jun 2020 13:22:32 +0200 Subject: [PATCH 2/2] Update train-aux.cpp Thanks for this fix. Actually this code should never be executed. But the "else" clause is there for safety. Anyway, how about just exiting - a couple of lines below is a similar case. Cheers, David --- src/aux-level/train-aux.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/aux-level/train-aux.cpp b/src/aux-level/train-aux.cpp index c1f74925..b6072069 100755 --- a/src/aux-level/train-aux.cpp +++ b/src/aux-level/train-aux.cpp @@ -44,8 +44,7 @@ Ptr train_svm(Ptr TrainData, par_train_t *train, FILE *fp) svm->setType(SVM::C_SVC); } else { printf("unknown SVM method\n"); - Ptr r; - return r; + exit(FAILURE); } svm->setKernel(SVM::RBF);