OpenCV Computer Vision with Python

OpenCV Computer Vision with Python
eBook: $17.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $47.98    Print cover: $29.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Set up OpenCV, its Python bindings, and optional Kinect drivers on Windows, Mac or Ubuntu
  • Create an application that tracks and manipulates faces
  • Identify face regions using normal color images and depth images

Book Details

Language : English
Paperback : 122 pages [ 235mm x 191mm ]
Release Date : April 2013
ISBN : 1782163921
ISBN 13 : 9781782163923
Author(s) : Joseph Howse
Topics and Technologies : All Books, Application Development, Open Source, Python

Table of Contents

Chapter 1: Setting up OpenCV
Chapter 2: Handling Files, Cameras, and GUIs
Chapter 3: Filtering Images
Chapter 4: Tracking Faces with Haar Cascades
Chapter 5: Detecting Foreground/Background Regions and Depth
Appendix A: Integrating with Pygame
Appendix B: Generating Haar Cascades for Custom Targets
  • Chapter 1: Setting up OpenCV
    • Choosing and using the right setup tools
      • Making the choice on Windows XP, Windows Vista, Windows 7, or Windows 8
        • Using binary installers (no support for depth cameras)
        • Using CMake and compilers
      • Making the choice on Mac OS X Snow Leopard, Mac OS X Lion, or Mac OS X Mountain Lion
        • Using MacPorts with ready-made packages
        • Using MacPorts with your own custom packages
        • Using Homebrew with ready-made packages (no support for depth cameras)
        • Using Homebrew with your own custom packages
      • Making the choice on Ubuntu 12.04 LTS or Ubuntu 12.10
        • Using the Ubuntu repository (no support for depth cameras)
        • Using CMake via a ready-made script that you may customize
      • Making the choice on other Unix-like systems
    • Running samples
    • Finding documentation, help, and updates
    • Summary
    • Chapter 2: Handling Files, Cameras, and GUIs
      • Basic I/O scripts
        • Reading/Writing an image file
        • Converting between an image and raw bytes
        • Reading/Writing a video file
        • Capturing camera frames
        • Displaying camera frames in a window
      • Project concept
      • An object-oriented design
        • Abstracting a video stream – managers.CaptureManager
        • Abstracting a window and keyboard – managers.WindowManager
        • Applying everything – cameo.Cameo
      • Summary
      • Chapter 3: Filtering Images
        • Creating modules
        • Channel mixing – seeing in Technicolor
          • Simulating RC color space
          • Simulating RGV color space
          • Simulating CMV color space
        • Curves – bending color space
          • Formulating a curve
          • Caching and applying a curve
          • Designing object-oriented curve filters
          • Emulating photo films
            • Emulating Kodak Portra
            • Emulating Fuji Provia
            • Emulating Fuji Velvia
            • Emulating cross-processing
        • Highlighting edges
        • Custom kernels – getting convoluted
        • Modifying the application
        • Summary
        • Chapter 4: Tracking Faces with Haar Cascades
          • Conceptualizing Haar cascades
          • Getting Haar cascade data
          • Creating modules
          • Defining a face as a hierarchy of rectangles
          • Tracing, cutting, and pasting rectangles
          • Adding more utility functions
          • Tracking faces
          • Modifying the application
            • Swapping faces in one camera feed
            • Copying faces between camera feeds
          • Summary
              • Appendix B: Generating Haar Cascades for Custom Targets
                • Gathering positive and negative training images
                • Finding the training executables
                  • On Windows
                  • On Mac, Ubuntu, and other Unix-like systems
                • Creating the training sets and cascade
                  • Creating <negative_description>
                  • Creating <positive_description>
                  • Creating <binary_description> by running <opencv_createsamples>
                  • Creating <cascade> by running <opencv_traincascade>
                • Testing and improving <cascade>
                • Summary

                Joseph Howse

                Joseph Howse might be at home right now, sitting on a sofa and writing a book, or he might have dashed away with a suitcase full of books, cameras, and computers. He is equipped to "see the world" or at least to do his work in computer vision. He is a software developer at Ad-Dispatch (Canada), where he makes augmented reality games for iOS and Android. Thanks to computer vision, the games can make use of real-world props such as a child's drawings, toys, or blanket-forts. He also provides training and consulting services. He is currently consulting at Market Beat (El Salvador) on an embedded systems project that uses OpenCV for face recognition. He holds three masters degrees in Computer Science, International Development Studies, and Business Administration (Dalhousie University, Canada). His research has been published by ISMAR (International Symposium on Mixed and Augmented Realities), and he would love to meet you there if you go. Android Application Programming with OpenCV is Joe's second book with Packt. His first book, OpenCV Computer Vision with Python, includes an introduction to face tracking and depth cameras (for example, Kinect) on Windows, Mac, and Linux. Joe likes cats, kittens, oceans, and seas. Felines and saline water sustain him. He lives with his multi-species family in Halifax, on Canada's Atlantic coast.
                Sorry, we don't have any reviews for this title yet.

                Code Downloads

                Download the code and support files for this book.

                Submit Errata

                Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.

                Sorry, there are currently no downloads available for this title.

                Frequently bought together

                OpenCV Computer Vision with Python +    Building Machine Learning Systems with Python =
                50% Off
                the second eBook
                Price for both: $34.50

                Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                What you will learn from this book

                • Install OpenCV and related software such as Python, NumPy, SciPy, OpenNI, and SensorKinect—all on Windows, Mac or Ubuntu
                • Capture, display, and save photos and real-time videos
                • Handle window events and input events using OpenCV's HighGui module or Pygame
                • Understand OpenCV's image format and how to perform efficient operations on OpenCV images with NumPy and SciPy
                • Apply “curves” and other color transformations to simulate the look of old photos, movies or video games
                • Apply an effect only to edges in an image
                • Copy and resize segments of an image
                • Apply an effect only to certain depths in an image by using data from a depth sensor such as Kinect
                • Track faces, eyes, noses and mouths by using prebuilt datasets
                • Track arbitrary objects by creating original datasets

                In Detail

                Computer Vision can reach consumers in various contexts via webcams, camera phones and gaming sensors like Kinect. OpenCV's Python bindings can help developers meet these consumer demands for applications that capture images, change their appearance and extract information from them, in a high-level language and in a standardized data format that is interoperable with scientific libraries such as NumPy and SciPy.

                "OpenCV Computer Vision with Python" is a practical, hands-on guide that covers the fundamental tasks of computer vision—capturing, filtering and analyzing images—with step-by-step instructions for writing both an application and reusable library classes.

                "OpenCV Computer Vision with Python" shows you how to use the Python bindings for OpenCV. By following clear and concise examples you will develop a computer vision application that tracks faces in live video and applies special effects to them. If you have always wanted to learn which version of these bindings to use, how to integrate with cross-platform Kinect drivers and and how to efficiently process image data with NumPy and SciPy then this book is for you.


                A practical, project-based tutorial for Python developers and hobbyists who want to get started with computer vision with OpenCV and Python.

                Who this book is for

                OpenCV Computer Vision with Python is written for Python developers who are new to computer vision and want a practical guide to teach them the essentials. Some understanding of image data (for example, pixels and color channels) would be beneficial. At a minimum you will need access to at least one webcam. Certain exercises require additional hardware like a second webcam, a Microsoft Kinect or an OpenNI-compliant depth sensor such as the Asus Xtion PRO.

                Code Download and Errata
                Packt Anytime, Anywhere
                Register Books
                Print Upgrades
                eBook Downloads
                Video Support
                Contact Us
                Awards Voting Nominations Previous Winners
                Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software