开发者

Why is there only one support vector in OpenCV's SVM

开发者 https://www.devze.com 2023-02-20 14:55 出处:网络
I am using libsvm to train a SVM with hog features. The model file has n support vectors. But when I try to use it in OpenCV\'s SVM I found that there is o开发者_运维技巧nly one vector in OpenCV\'s mo

I am using libsvm to train a SVM with hog features. The model file has n support vectors. But when I try to use it in OpenCV's SVM I found that there is o开发者_运维技巧nly one vector in OpenCV's model. How does OpenCV do it??


I guess libsvm stores support vectors, whereas opencv just uses a weight vector to store the hyperplane (one vector + one scalar suffices to describe a plane) - you can get there from the decision function using the support vectors by swapping sum and scalar product.


Here is the explanation from Learning OpenCV3: In the case of linear SVM, all the support vectors for each decision plane can be compressed into a single vector that will basically describe the separating hyperplane.

0

精彩评论

暂无评论...
验证码 换一张
取 消