Binary image-Morphological processing 3 open operation and closed operation

Source: Internet
Author: User

Study Dip 13th dayThe opening crap .

In short, the so-called open operation and closed operation is to combine the corrosion and expansion, the first corrosion after the expansion is open, after the expansion of corrosion is off, as to why is open why is off, I can not remember at the beginning, I remember the teacher did not tell me why call Open, why called closed, but in the following introduction, will give the reason

Mathematical Principles

Well, the formula is not ready ...

Propertiesopen operation, usually smooth the outline of the object, the narrower narrow neck (slender white lines), so called Open, and eliminate small protrusion. closed operation, the general will also smooth the outline of the object, but in contrast to the open operation, bridging the narrower gaps and slender ravines, so called closed, eliminating small voids, filling the contour of the break. all the so-called thin and narrow are compared to the structural element se, so the key is SE. idempotent (idempotent): is when the same se on the image to do open (closed) operation, do once and do multiple times, the result is the same. CodeThe code, which is entirely based on corrosion and expansion of the operation, wherein the corrosion and expansion of the concrete implementation, see the previous section:
Open operation Void Open (Iplimage *src,iplimage *dst,iplimage *se,position *center) {    Erode (src, DST, SE, center);    Dilate (DST, DST, SE, center);} Off operation Void Close (Iplimage *src,iplimage *dst,iplimage *se,position *center) {    dilate (src, DST, SE, center);    Erode (DST, DST, SE, center);    }


Resultsall of the following results of SE are 3x3 all 1, center is the middle element, that is, SE is isotropic. Open Operation: The original image on the left, the left is open operation results, the right is open operation results and the difference between the original, it can be seen that the small white protrusions, slender lines were disposed of, while the narrow Black Gully is retained:
closed operation: The upper left is the original, the left is closed operation results, the upper right is the original and closed operation results of the difference. It can be seen that the original black strips (i.e. black ravines) are filled, but the white projection points are retained.
The following is a Lenna diagram with a threshold value of 100:Open Results for Lena:
close result of Lena

Binary image-Morphological processing 3 open operation and closed operation

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.