Skip to Main Content
Learning OpenCV
book

Learning OpenCV

by Gary Bradski, Adrian Kaehler
September 2008
Beginner to intermediate content levelBeginner to intermediate
580 pages
20h 7m
English
O'Reilly Media, Inc.
Content preview from Learning OpenCV

Image Morphology

OpenCV provides a fast, convenient interface for doing morphological transformations [Serra83] on an image. The basic morphological transformations are called dilation and erosion, and they arise in a wide variety of contexts such as removing noise, isolating individual elements, and joining disparate elements in an image. Morphology can also be used to find intensity bumps or holes in an image and to find image gradients.

Dilation and Erosion

Dilation is a convolution of some image (or region of an image), which we will call A, with some kernel, which we will call B. The kernel, which can be any shape or size, has a single defined anchor point. Most often, the kernel is a small solid square or disk with the anchor point at the center. The kernel can be thought of as a template or mask, and its effect for dilation is that of a local maximum operator. As the kernel B is scanned over the image, we compute the maximal pixel value overlapped by B and replace the image pixel under the anchor point with that maximal value. This causes bright regions within an image to grow as diagrammed in Figure 5-6. This growth is the origin of the term "dilation operator".

Morphological dilation: take the maximum under the kernel B

Figure 5-6. Morphological dilation: take the maximum under the kernel B

Erosion is the converse operation. The action of the erosion operator is equivalent to computing a local minimum over the area of the kernel. Erosion ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning OpenCV 3

Learning OpenCV 3

Adrian Kaehler, Gary Bradski
Learning OpenCV, 2nd Edition

Learning OpenCV, 2nd Edition

Adrian Kaehler, Gary Bradski
Practical OpenCV

Practical OpenCV

Samarth Brahmbhatt
Machine Learning for OpenCV

Machine Learning for OpenCV

Michael Beyeler, Michael Beyeler (USD)

Publisher Resources

ISBN: 9780596516130Supplemental ContentErrata Page