O'Reilly logo

OpenCV Essentials by Jesus Salido Tercero, Julio Alberto Patón Incertis, Ismael Serrano Gracia, Gloria Bueno García, Noelia Vállez Enano, Mª del Milagro Fernández Carrobles, Oscar Deniz Suarez

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

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 ...

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

Start Free Trial

No credit card required