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)

Compile OpenCV.js

To compile OpenCV.js, we need to install Emscripten. Emscripten requires the following:

  • Python 2.7
  • Node.js
  • cmake
  • Java runtime

We can install these dependencies following the next instructions:

# Install Python
sudo apt-get install python2.7

# Install node.js
sudo apt-get install nodejs

# Install CMake (optional, only needed for tests and building Binaryen)
sudo apt-get install cmake

# Install Java (optional, only needed for Closure Compiler minification)
sudo apt-get install default-jre

Now, we have to download Emscripten from the GitHub repository:

# Get the emsdk repo
git clone

# Enter that directory
cd emsdk

Now, we only have to update and install the environment variables required by Emscripten and we can do that following the next steps in the command line:

# Download and install the latest SDK tools.
./emsdk install...