O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Computer Vision for the Web

Book Description

Unleash the power of the Computer Vision algorithms in JavaScript to develop vision-enabled web content

About This Book

  • Explore the exciting world of image processing, and face and gesture recognition, and implement them in your website
  • Develop wonderful web projects to implement Computer Vision algorithms in an effective way
  • A fast-paced guide to help you deal with real-world Computer Vision applications using JavaScript libraries

Who This Book Is For

If you have an interest in Computer Vision or wish to apply Computer Vision algorithms such as face, custom object, and gesture recognition for an online application, then this book is ideal for you. Prior understanding of the JavaScript language and core mathematical concepts is recommended.

What You Will Learn

  • Apply complex Computer Vision algorithms in your applications using JavaScript
  • Put together different JavaScript libraries to discover objects in photos
  • Get to grips with developing simple computer vision applications on your own
  • Understand when and why you should use different computer vision methods
  • Apply various image filters to images and videos
  • Recognize and track many different objects, including face and face particles using powerful face recognition algorithms
  • Explore ways to control your browser without touching the mouse or keyboard

In Detail

JavaScript is a dynamic and prototype-based programming language supported by every browser today. JavaScript libraries boast outstanding functionalities that enable you to furnish your own Computer Vision projects, making it easier to develop JavaScript–based applications, especially for web-centric technologies. It makes the implementation of Computer Vision algorithms easier as it supports scheme-based functional programming.

This book will give you an insight into controlling your applications with gestures and head motion and readying them for the web. Packed with real-world tasks, it begins with a walkthrough of the basic concepts of Computer Vision that the JavaScript world offers us, and you’ll implement various powerful algorithms in your own online application. Then, we move on to a comprehensive analysis of JavaScript functions and their applications. Furthermore, the book will show you how to implement filters and image segmentation, and use tracking.js and jsfeat libraries to convert your browser into Photoshop. Subjects such as object and custom detection, feature extraction, and object matching are covered to help you find an object in a photo. You will see how a complex object such as a face can be recognized by a browser as you move toward the end of the book. Finally, you will focus on algorithms to create a human interface.

By the end of this book, you will be familiarized with the application of complex Computer Vision algorithms to develop your own applications, without spending much time learning sophisticated theory.

Style and approach

This book is an easy-to-follow project-based guide that throws you directly into the excitement of the Computer Vision theme. A "more in less" approach is followed by important concepts explained in a to-the-point, easy-to-understand manner.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

Table of Contents

  1. Computer Vision for the Web
    1. Table of Contents
    2. Computer Vision for the Web
    3. Credits
    4. About the Author
    5. About the Reviewer
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
          1. Downloading the color images of this book
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Math Never Was So Simple!
      1. Installation and core structure representation of JSFeat
      2. Initializing the project
      3. Understanding a digital image
        1. Loading an image into a matrix
        2. Basic matrix operations
        3. Going deeper
        4. Matrix displaying
      4. Useful functions and where to use them
        1. Sorting using JSFeat
        2. Linear algebra
        3. A perspective example
      5. Summary
    9. 2. Turn Your Browser into Photoshop
      1. Introducing the tracking.js library
        1. Installation and image loading
        2. Conversion between JSFeat and tracking.js image formats
      2. What is filtering and how to use it?
        1. Image convolution
        2. The Gaussian filter and separate convolution
        3. The box blur
        4. The integral image
      3. Basic edge detection
        1. The Sobel filter
        2. Other operators
      4. Advanced image processing
        1. The Canny edge detector
        2. Histogram equalization
      5. Summary
    10. 3. Easy Object Detection for Everyone
      1. Detecting color objects
        1. Using predefined colors with the tracking.js library
        2. Using your own colors
      2. Digging into the tracking.js API
        1. Using the <img> and <video> tags
        2. Building a custom tracker
      3. Image features
        1. Detecting key points
        2. A practical example
      4. Descriptors and object matching
        1. The BRIEF and ORB descriptors
        2. Descriptors implementation and their matching
        3. Finding an object location
      5. Summary
    11. 4. Smile and Wave, Your Face Has Been Tracked!
      1. Face detection with JSFeat
        1. Face detection using Haar-like features
        2. Brightness binary features
      2. Tagging people with tracking.js
        1. Haar features with tracking.js
      3. Tagging people in photos
      4. Head tracking with Camshift
        1. The idea behind head tracking
        2. The head tracking application
      5. Summary
    12. 5. May JS Be with You! Control Your Browser with Motion
      1. Basic tracking with tracking.js
        1. An example of an object tracking application
      2. Controlling objects with the head motion
        1. The Head-coupled perspective
        2. Controlling a simple box
      3. Optical flow for motion estimation
        1. The Lucas-Kanade optical flow
        2. Optical flow map with oflow
        3. Track points with JSFeat
        4. Zooming with gestures
      4. Summary
    13. 6. What's Next?
      1. Refresh your memory
      2. Importance of client-side scripting
      3. Other interesting libraries in Computer Vision
        1. CCV library and its extensions
        2. Face detection and more
        3. Object detection with js-objectdetect
      4. Summary
    14. Index