Book Image

Raspberry Pi Computer Vision Programming

By : Ashwin Pajankar
Book Image

Raspberry Pi Computer Vision Programming

By: Ashwin Pajankar

Overview of this book

<p>This book will provide you with the skills you need to successfully design and implement your own Raspberry Pi and Python-based computer vision projects.</p> <p>From the beginning, this book will cover how to set up your Raspberry Pi for computer vision applications, exploring the basics of OpenCV, and how to design and implement real-life computer vision applications on your own. By sequentially working through the steps in each chapter, you will quickly be able to master the features of OpenCV. In the end of the book, you will also be introduced to SimpleCV, which is another powerful computer vision library for Python. Featuring plenty of coding examples and exercises, this book offers you an unparalleled learning experience.</p>
Table of Contents (17 chapters)
Raspberry Pi Computer Vision Programming
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
5
Let's Make Some Noise
Index

Image contours


A contour is a curve joining all the continuous points along the boundary with the same color value. The detecting of contours in an image is very useful if you want to detect the boundaries in images. In an image, the edges are computed as points that are the extremes of the image gradient in the direction of the gradient. Contours are often obtained from edges, but they are aimed to be object contours. Thus, they need to be closed curves and are different from edges.

It is helpful to threshold an image before extracting contours to increase the accuracy of the image.

OpenCV has cv2.findContours() to find the contours in an image. It takes an image, a contour retrieval mode, and a contour approximation method as arguments and returns the contours of the image. Contour retrieval mode can be CV_RETR_EXTERNAL, CV_RETR_LIST, CV_RETR_CCOMP, or CV_RETR_TREE. The contour approximation method can be CV_CHAIN_APPROX_NONE, CV_CHAIN_APPROX_SIMPLE, CV_CHAIN_APPROX_TC89_L1, or CV_CHAIN_APPROX_TC89_KCOS...