O'Reilly logo

OpenCV Essentials by Jesus Salido Tercero, Julio Alberto Patón Incertis, Ismael Serrano Gracia, Gloria Bueno García, Noelia Vállez Enano, Mª del Milagro Fernández Carrobles, Oscar Deniz Suarez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

SVM for classification

The Support Vector Machine (SVM) classifier finds a discriminant function by maximizing the geometrical margin between the classes. Thus, the space is mapped in such a way that the classes are as widely separated as possible. SVM minimizes both the training error and the geometrical margin. Nowadays, this classifier is one of the best classifiers available and has been applied to many real-world problems. The following SVMClassifier sample code performs a classification using the SVM classifier and a dataset of 66 image objects. The dataset is divided into four classes: a training shoe (class 1), a cuddly toy (class 2), a plastic cup (class 3), and a bow (class 4). The following screenshot shows the examples of the four ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required