O'Reilly logo

Computer Vision with Python 3 by Saurabh Kapur

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

Image rotation and scaling

This is similar to image translation, only this time we rotate a given image with random angles. This helps the program to learn the object at different orientations. We also scale the image and make it smaller or bigger before we pass it to our machine learning program.

These simple techniques are a way of artificially expanding the original datasets and go a long way in making the program more robust and invariant. There are other preprocessing techniques such as color averaging that could be used too.

But before diving into machine learning algorithms, let's install a new library that we will use in this chapter—scikit-learn.

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