Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Machine Learning for OpenCV
Machine Learning for OpenCV

Machine Learning for OpenCV: Intelligent image processing with Python

Arrow left icon
Profile Icon Michael Beyeler (USD) Profile Icon Michael Beyeler
Arrow right icon
€18.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4 (13 Ratings)
Paperback Jul 2017 382 pages 1st Edition
eBook
€22.99 €32.99
Paperback
€41.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Michael Beyeler (USD) Profile Icon Michael Beyeler
Arrow right icon
€18.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4 (13 Ratings)
Paperback Jul 2017 382 pages 1st Edition
eBook
€22.99 €32.99
Paperback
€41.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€22.99 €32.99
Paperback
€41.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Machine Learning for OpenCV

Working with Data in OpenCV and Python

Now that we have whetted our appetite for machine learning, it is time to delve a little deeper into the different parts that make up a typical machine learning system.

Far too often, you hear someone throw around the phrase, just apply machine learning to your data!, as if that will instantly solve all your problems. You can imagine that the reality of this is much more intricate. Although, I will admit that nowadays it is incredibly easy to build your own machine learning system simply by cutting and pasting just a few lines of code from the internet. However, in order to build a system that is truly powerful and effective, it is essential to have a firm grasp of the underlying concepts and an intimate knowledge of the strengths and weaknesses of each method. So don't worry if you aren't considering yourself a machine learning...

Understanding the machine learning workflow

As mentioned earlier, machine learning is all about building mathematical models in order to understand data. The learning aspect enters this process when we give a machine learning model the capability to adjust its internal parameters; we can tweak these parameters so that the model explains the data better . In a sense, this can be understood as the model learning from the data. Once the model has learned enough--whatever that means--we can ask it to explain newly observed data.

This process is illustrated in the following figure:

A typical workflow to tackle machine learning problems

Let's break it down step by step.

The first thing to notice is that machine learning problems are always split into (at least) two distinct phases:

  • A training phase, during which we aim to train a machine learning model on a set of data that we...

Dealing with data using OpenCV and Python

Although raw data can come from a variety of sources and in a wide range of formats, it will help us to think of all data fundamentally as arrays of numbers. For example, images can be thought of as simply 2D arrays of numbers representing pixel brightness across an area. Sound clips can be thought of 1D arrays of intensity over time. For this reason, efficient storage and manipulation of numerical arrays is absolutely fundamental to machine learning.

If you have mostly been using OpenCV's C++ application programming interface (API) and plan on continuing to do so, you might find that dealing with data in C++ can be a bit of a pain. Not only will you have to deal with the syntactic overhead of the C++ language, but you will also have to wrestle with different data types and cross-platform compatibility issues.

This process is radically...

Summary

In this chapter, we talked about a typical workflow to deal with machine learning problems: how we can extract informative features from raw data, how we can use data and labels to train a machine learning model, and how we can use the finalized model to predict new data labels. We learned that it is essential to split data into a training set and test set, as this is the only way to know how well a model will generalize to new data points.

On the software side of things, we significantly improved our Python skills. We learned how to use NumPy arrays to store and manipulate data and how to use Matplotlib for data visualization. We talked about scikit-learn and its many useful data resources. Finally, we also addressed OpenCV's own TrainData container, which provides some relief for users of OpenCV's C++ API.

With these tools in hand, we are now ready to implement...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Load, store, edit, and visualize data using OpenCV and Python
  • Grasp the fundamental concepts of classification, regression, and clustering
  • Understand, perform, and experiment with machine learning techniques using this easy-to-follow guide
  • Evaluate, compare, and choose the right algorithm for any task

Description

Machine learning is no longer just a buzzword, it is all around us: from protecting your email, to automatically tagging friends in pictures, to predicting what movies you like. Computer vision is one of today's most exciting application fields of machine learning, with Deep Learning driving innovative systems such as self-driving cars and Google’s DeepMind. OpenCV lies at the intersection of these topics, providing a comprehensive open-source library for classic as well as state-of-the-art computer vision and machine learning algorithms. In combination with Python Anaconda, you will have access to all the open-source computing libraries you could possibly ask for. Machine learning for OpenCV begins by introducing you to the essential concepts of statistical learning, such as classification and regression. Once all the basics are covered, you will start exploring various algorithms such as decision trees, support vector machines, and Bayesian networks, and learn how to combine them with other OpenCV functionality. As the book progresses, so will your machine learning skills, until you are ready to take on today's hottest topic in the field: Deep Learning. By the end of this book, you will be ready to take on your own machine learning problems, either by building on the existing source code or developing your own algorithm from scratch!

Who is this book for?

This book targets Python programmers who are already familiar with OpenCV; this book will give you the tools and understanding required to build your own machine learning systems, tailored to practical real-world tasks.

What you will learn

  • Explore and make effective use of OpenCV s machine learning module
  • Learn deep learning for computer vision with Python
  • Master linear regression and regularization techniques
  • Classify objects such as flower species, handwritten digits, and pedestrians
  • Explore the effective use of support vector machines, boosted decision trees, and random forests
  • Get acquainted with neural networks and Deep Learning to address real-world problems
  • Discover hidden structures in your data using k-means clustering
  • Get to grips with data pre-processing and feature engineering

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jul 14, 2017
Length: 382 pages
Edition : 1st
Language : English
ISBN-13 : 9781783980284
Vendor :
Intel
Category :
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Jul 14, 2017
Length: 382 pages
Edition : 1st
Language : English
ISBN-13 : 9781783980284
Vendor :
Intel
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 151.97
Python: Deeper Insights into Machine Learning
€67.99
Statistics for Machine Learning
€41.99
Machine Learning for OpenCV
€41.99
Total 151.97 Stars icon

Table of Contents

12 Chapters
A Taste of Machine Learning Chevron down icon Chevron up icon
Working with Data in OpenCV and Python Chevron down icon Chevron up icon
First Steps in Supervised Learning Chevron down icon Chevron up icon
Representing Data and Engineering Features Chevron down icon Chevron up icon
Using Decision Trees to Make a Medical Diagnosis Chevron down icon Chevron up icon
Detecting Pedestrians with Support Vector Machines Chevron down icon Chevron up icon
Implementing a Spam Filter with Bayesian Learning Chevron down icon Chevron up icon
Discovering Hidden Structures with Unsupervised Learning Chevron down icon Chevron up icon
Using Deep Learning to Classify Handwritten Digits Chevron down icon Chevron up icon
Combining Different Algorithms into an Ensemble Chevron down icon Chevron up icon
Selecting the Right Model with Hyperparameter Tuning Chevron down icon Chevron up icon
Wrapping Up Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4
(13 Ratings)
5 star 61.5%
4 star 23.1%
3 star 7.7%
2 star 7.7%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Jorge Paredes Dec 23, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Si bien cubre muy bien el tema de OpenCV, contiene muchisima información valiosa para empezar con sklearn y numpy, breves pero efectivas introducciones de ambos. El libro sustenta con ejemplos claros la teoria, incluye poca pero necesaria math, aunque no abunda tanto en ello sino que va directo al "hands on" casi desde las primeras páginas.Para principiantes como yo en el tema de Machine Learning es un libro excelente, aún no lo termino pero hasta ahora he logrado entender muchos términos que en otros libros daban por hecho y no me permitían avanzar de manera efectiva,Si eres developer y quieres iniciarte con Machine Learning es un primer paso excelente.
Amazon Verified review Amazon
Haotian Zhang Oct 12, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Micheal's book is intended for starters, undergraduates & PhD students, researchers, primarily in the machine learning or related area.This book will be an essential reference for practitioners of modern machine learning. It covers the basic concepts such as Decision Tree, SVMs, Classification and etc. and the powerful modern computing methods that build on those concepts. I've been following this book on Git for quite a long time and I even forked the original code. It uses the Python Jupyter Notebook to describe concepts in each chapter and also uses the OpenCV, Python Libraries like Scikit-learn and Machine Learning Framework Keras. Both the book and code are quite helpful towards my study. A must-buy for anyone interested in machine learning or curious about how to extract useful knowledge from Computer Vision.
Amazon Verified review Amazon
Lohith Subramanya Oct 24, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Wonderful book to enhance your Machine Learning and Computer Vision skills.I would recommend this book to anybody who'd wanna explore and enhance their knowledge on Machine Learning techniques.
Amazon Verified review Amazon
laksh Jan 05, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good read
Amazon Verified review Amazon
Aundraya Hernandez Jul 25, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book has been a great read. Covers all the fundamentals and walks you through the problems step by step. Highly recommended!
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.