Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
OpenCV Essentials

You're reading from   OpenCV Essentials Acquire, process, and analyze visual content to build full-fledged imaging applications using OpenCV

Arrow left icon
Product type Paperback
Published in Aug 2014
Publisher
ISBN-13 9781783984244
Length 214 pages
Edition 1st Edition
Tools
Arrow right icon
Toc

Table of Contents (10) Chapters Close

Preface 1. Getting Started FREE CHAPTER 2. Something We Look At – Graphical User Interfaces 3. First Things First – Image Processing 4. What's in the Image? Segmentation 5. Focusing on the Interesting 2D Features 6. Where's Wally? Object Detection 7. What Is He Doing? Motion 8. Advanced Topics Index

Contours and connected components


Contour extraction operations can be considered halfway between feature extraction and segmentation, since a binary image is produced in which image contours are separated from other homogeneous regions. Contours will typically correspond to object boundaries.

While a number of simple methods detect edges in images (for example, the Sobel and Laplace filters), the Canny method is a robust algorithm for doing this.

Note

This method uses two thresholds to decide whether a pixel is an edge. In what is called a hysteresis procedure, a lower and an upper threshold are used (see http://docs.opencv.org/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.html). Since OpenCV already includes a good example of the Canny edge detector (in [opencv_source_code]/samples/cpp/edge.cpp), we do not include one here (but see the following floodFill example). Instead, we will go on to describe other highly useful functions based on detected edges.

To detect straight lines...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image