简体   繁体   中英

OpenCV 3.0.0 C++: Cannot get knn->load(“file.yml”) to work

I have saved the knn model successfully using knn->save("file.yml").. But cannot seem to load the model using knn->load("file.yml")... Is something wring with the formatting of the load command??

Help appreciated..

Use this code

Ptr<KNearest> svm = Algorithm::load<KNearest>("treino.knn");

or

Ptr<KNearest> svm = KNearest::load<KNearest>("treino.knn");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM