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)

Image processing and basic user interface

Now that we know how to read images and webcam streams, we are going to explain some more basic image processing functions and how to create basic controls to change their parameters. In this section, we are going to create a web page that allows users to choose a filter to apply to a loaded image. The filters that we are going to apply are threshold, Gaussian blur, canny, and histogram equalization. Each filter or algorithm takes different input parameters, which we are going to add to user interfaces to control each one.

First, we are going to generate the required elements to create our application. As the user has the ability to choose the algorithm/filter to apply, we are going to add a select HTML element with the possible options to choose from:

<select class="form-control" id="filter">
<option value...