OpenCV notes (ix)--More morphological transformations

Source: Internet
Author: User

Erode and dilate are basic morphological operations, and we can compose more morphological operations based on these two operations.

First, open Operation Openning

DST = open (src, Element) = dilate (Erode (src, Element))

Open operation is to the image of the first corrosion and re-expansion, the main role is to remove the small white area.

Second, closed Operation Closing

DST = Close (src, Element) = Erode (dilate (src, Element))

Closed operation is to expand an image first and then corrode, the main role is to remove small areas of black.

Third, morphological gradient operation morphological Gradient

DST = Morphgrad (src, Element) = dilate (src, Element)-Erode (src, Element)

The morphological gradient operation, in which the swelling image is subtracted from the corroded image, the main function is to find the contour of the object.

Four, Top Hat

DST = tophat (src, Element) = Src-open (src, Element)

Not clear for the time being.

Five, Black Hat

DST = Blackhat (src, Element) = Close (src, Element)-src

Not clear for the time being.

The functions that complete these operations are defined in OPENCV:

void Morphologyex (Inputarray src, outputarray dst, int op, Inputarray kernel, point anchor=point ( -1,-1), int iterations= 1, int bordertype=border_constant, const scalar& bordervalue=morphologydefaultvalue ())

The parameter op specifies the morphological operation to be performed, Morph_open open operation, Morph_close closed operation, morph_gradient morphology gradient operation, Morph_tophat tophat operation, Morph_blackhat Blackhat operation.

OpenCV notes (ix)--More morphological transformations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.