Skip to Content
OpenCV By Example
book

OpenCV By Example

by Prateek Joshi, David Millán Escrivá, Vinícius G. Mendonça
January 2016
Intermediate to advanced
296 pages
5h 59m
English
Packt Publishing
Content preview from OpenCV By Example

Other morphological operators

Here are some other morphological operators that are interesting. Let's first take a look at the output image. We can take a look at the code at the end of this section.

Morphological opening

This is an operation that opens a shape. This operator is frequently used for noise removal in an image. We can achieve morphological opening by applying erosion followed by dilation to an image. The morphological opening process basically removes small objects from the foreground in the image by placing them in the background:

Morphological opening

Here is the function to the perform morphological opening:

Mat performOpening(Mat inputImage, int morphologyElement, ...
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

Mastering OpenCV 4 - Third Edition

Mastering OpenCV 4 - Third Edition

Roy Shilkrot, David Millán Escrivá

Publisher Resources

ISBN: 9781785280948Supplemental Content