OpenCV provides a whole range of different SVM kernels with which we can experiment. Some of the most commonly used ones include:
- cv2.ml.SVM_LINEAR: This is the kernel we used previously. It provides a linear decision boundary in the original feature space (the x and y values).
- cv2.ml.SVM_POLY: This kernel provides a decision boundary that is a polynomial function in the original feature space. In order to use this kernel, we also have to specify a coefficient via svm.setCoef0 (usually set to 0) and the degree of the polynomial via svm.setDegree.
- cv2.ml.SVM_RBF: This kernel implements the kind of Gaussian function we discussed earlier.
- cv2.ml.SVM_SIGMOID: This kernel implements a sigmoid function, similar to the one we ...