How to do it...

In this recipe, we will build another stop sign classifier. This is obviously just a toy example that serves to illustrate the learning procedure:

  1. As we explained in the previous recipe, the first step is to collect samples for training. In our example, the set of positive samples that we will be using is as follows:
  1. And our (very small) set of negative samples is as follows:
  1. We will now learn how to differentiate between these two classes using SVM, as implemented in the cv::svm class. To build a robust classifier, we ...

Get OpenCV 4 Computer Vision Application Programming Cookbook - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.