Book Image

OpenCV Computer Vision with Python

By : Joseph Howse
Book Image

OpenCV Computer Vision with Python

By: Joseph Howse

Overview of this book

<p>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 how to efficiently process image data with NumPy and SciPy, then this book is for you.</p> <p>This book has practical, project-based tutorials for Python developers and hobbyists who want to get started with computer vision with OpenCV and Python. It is a 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.</p>
Table of Contents (14 chapters)
OpenCV Computer Vision with Python
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Channel mixing – seeing in Technicolor


Channel mixing is a simple technique for remapping colors. The color at a destination pixel is a function of the color at the corresponding source pixel (only). More specifically, each channel's value at the destination pixel is a function of any or all channels' values at the source pixel. In pseudocode, for a BGR image:

dst.b = funcB(src.b, src.g, src.r)
dst.g = funcG(src.b, src.g, src.r)
dst.r = funcR(src.b, src.g, src.r)

We may define these functions however we please. Potentially, we can map a scene's colors much differently than a camera normally does or our eyes normally do.

One use of channel mixing is to simulate some other, smaller color space inside RGB or BGR. By assigning equal values to any two channels, we can collapse part of the color space and create the impression that our palette is based on just two colors of light (blended additively) or two inks (blended subtractively). This type of effect can offer nostalgic value because early...