Book Image

Computer Vision Projects with OpenCV and Python 3

By : Matthew Rever
Book Image

Computer Vision Projects with OpenCV and Python 3

By: Matthew Rever

Overview of this book

Python is the ideal programming language for rapidly prototyping and developing production-grade codes for image processing and Computer Vision with its robust syntax and wealth of powerful libraries. This book will help you design and develop production-grade Computer Vision projects tackling real-world problems. With the help of this book, you will learn how to set up Anaconda and Python for the major OSes with cutting-edge third-party libraries for Computer Vision. You'll learn state-of-the-art techniques for classifying images, finding and identifying human postures, and detecting faces within videos. You will use powerful machine learning tools such as OpenCV, Dlib, and TensorFlow to build exciting projects such as classifying handwritten digits, detecting facial features,and much more. The book also covers some advanced projects, such as reading text from license plates from real-world images using Google’s Tesseract software, and tracking human body poses using DeeperCut within TensorFlow. By the end of this book, you will have the expertise required to build your own Computer Vision projects using Python and its associated libraries.
Table of Contents (9 chapters)

Introducing TensorFlow with digit classification

We're going to see TensorFlow in action and see how we can perform digit classification with a tractable amount of code. TensorFlow is Google's machine learning library, for numerical analysis in general. It is called TensorFlow because it supposedly flows tensors, where tensors are defined to be arrays of n dimensions. Tensors have a real geometric meaning that just multidimensional arrays don't necessarily classify, but we're just going to use that term. A tensor is just a multidimensional array.

Here, we're going to do a simple softmax example. It's a very simple model; you can visit TensorFlow's own website (https://www.tensorflow.org/get_started/mnist/beginners) for more information. Let's have a look at the following code:

data_dir = '/tmp/tensorflow/mnist/input_data'
mnist...