Face detection 2

In one fell swoop, GoCV has provided us with everything necessary to do real-time face detection. But is it easy to use with other face detection algorithms? The answer is yes, but some work is required.

The algorithm we want to use is the PICO algorithm. Recall that images in GoCV are in the gocv.Mat type. In order for PIGO to use that, we would need to convert that into a format readable by PICO. Incidentally, such a shared format is the image.Image of the standard library.

Recall once again that the gocv.Mat type has a method .ToImage(), which returns an image.Image. That's our bridge!

Before crossing it, let's look at how to create a PIGO classifier. Here's a function to do so:

```func pigoSetup(width, height int) (*image.NRGBA, ...

Get Go Machine Learning Projects 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.