2016-05-28 04:53:46 -0600 | received badge | ● Student (source) |
2016-05-28 04:53:42 -0600 | received badge | ● Nice Answer (source) |
2016-01-03 07:54:15 -0600 | received badge | ● Teacher (source) |
2015-12-29 09:49:29 -0600 | received badge | ● Self-Learner (source) |
2015-12-29 09:44:34 -0600 | answered a question | SVM::getSupportVectors returns wrong answers Thanks to LorenaGdL, I think I know the cause of the problem. In the case of linear SVM, getSupportVectors() actually returns one "compressed" support vector that can be used in fast prediction. This method improves performance but have difficulty retrieving "uncompressed" support vectors. In the 3.1.0 version of OpenCV, this has been fixed by adding another function SVM::getUncompressedSupportVectors(), which returns all support vectors as a matrix. One possible solution, as suggested by LorenaGdL, is to use a POLY type of kernel. The following code set a SVM to have a POLY kernel that behaves the same as a LINEAR kernel. |
2015-12-23 05:30:20 -0600 | commented question | SVM::getSupportVectors returns wrong answers Thank you! It works fine after I used SVM::POLY instead of SVM::LINEAR. |
2015-12-22 11:15:25 -0600 | received badge | ● Editor (source) |
2015-12-22 11:13:49 -0600 | asked a question | SVM::getSupportVectors returns wrong answers Hi! I'm running the demo program presented in the OpenCV tutorial(introduction to SVM) website , but I get a different result from the result shown in the link.
As you can see from the picture, the support vectors are not correctly plotted. Those three points(support vectors) that are closest to the separate line are not encircled by gray rings. I single stepped into the code and found that SVM::getSupportVectors() returned only one vector that is very cloes to (0, 0), which is highlighted by a gray ring in the upper left corner. Any idea about what is going wrong? I'm using OpenCV 3.0.0 with VS2015 in Win7. The code is as follows (I copied the code from the tutorial and pasted it into VS). |