Book Image

Mastering OpenCV 4 - Third Edition

By : Roy Shilkrot, David Millán Escrivá
Book Image

Mastering OpenCV 4 - Third Edition

By: Roy Shilkrot, David Millán Escrivá

Overview of this book

Mastering OpenCV, now in its third edition, targets computer vision engineers taking their first steps toward mastering OpenCV. Keeping the mathematical formulations to a solid but bare minimum, the book delivers complete projects from ideation to running code, targeting current hot topics in computer vision such as face recognition, landmark detection and pose estimation, and number recognition with deep convolutional networks. You’ll learn from experienced OpenCV experts how to implement computer vision products and projects both in academia and industry in a comfortable package. You’ll get acquainted with API functionality and gain insights into design choices in a complete computer vision project. You’ll also go beyond the basics of computer vision to implement solutions for complex image processing projects. By the end of the book, you will have created various working prototypes with the help of projects in the book and be well versed with the new features of OpenCV4.
Table of Contents (12 chapters)

Optical flow in your browser

In this section, we are going to develop an optical flow over a set of points. To choose the best points to track, we are going to use an OpenCV function to choose them.

In previous chapters, we were going to construct the HTML code that we needed to grab the frames and show the result. Then we require the video element and a canvas to show the processed result, and a start button to process input frames. The HTML code looks like this:

<div class="row">
<div class="col">
<div id="status" class="alert alert-primary" role="alert"><img src="img/ajax-loader.gif" /> Loading OpenCV...</div>
</div>
</div>
<a href="#" class="btn btn-primary" style="display: none;" id="cv_start">Start</a>
<div class...