Code:
outSVM = cv::ml::SVM::create();
outSVM->setType(SVM::C_SVC);
outSVM->setKernel(SVM::CHI2);
//outSVM->setC(100);
//outSVM->setGamma(100);
Ptr<TrainData> pt = ml::TrainData::create(samples, ml::ROW_SAMPLE,
labels);
// bool result = outSVM->train(pt);
bool result = outSVM->trainAuto(pt);
Error:
Segmentation fault (core dumped)
The outSVM->train(pt);
can run , but the trainAuto(pt)
can't work .
Debug informetion:
#0 0x00007fffee4b7707 in __memmove_avx_unaligned_erms ()
at /usr/lib/libc.so.6
#1 0x00007ffff2e41db9 in cv::ml::SVMImpl::do_train(cv::Mat const&, cv::Mat const&) () at /usr/local/lib/libopencv_ml.so.4.1
#2 0x00007ffff2e4691d in cv::ml::SVMImpl::TrainAutoBody::operator()(cv::Range const&) const () at /usr/local/lib/libopencv_ml.so.4.1
#3 0x00007fffeeb726d7 in (anonymous namespace)::ParallelLoopBodyWrapper::operator()(cv::Range const&) const ()
at /usr/local/lib/libopencv_core.so.4.1
#4 0x00007fffeeb7358d in cv::ParallelJob::execute(bool) ()
at /usr/local/lib/libopencv_core.so.4.1
#5 0x00007fffeeb739d9 in cv::WorkerThread::thread_body() ()
at /usr/local/lib/libopencv_core.so.4.1
#6 0x00007fffeeb73bf9 in cv::WorkerThread::thread_loop_wrapper(void*)
() at /usr/local/lib/libopencv_core.so.4.1
#7 0x00007fffee3354cf in start_thread () at /usr/lib/libpthread.so.0
#8 0x00007fffee4522d3 in clone () at /usr/lib/libc.so.6