EMGUCV functions in the image Class (ii) Use MORPHOLOGYEX for more transformations

Source: Internet
Author: User

All transformations in the Morphologyex are as shown

Call Method:

[CSharp]View PlainCopyprint?
    1. Mat AAA = Cvinvoke.getstructuringelement (Emgu.CV.CvEnum.ElementShape.Rectangle, new Size (5, 5), new Point (2, 2)  );
    2. Imagebox1.image = A.morphologyex (Emgu.CV.CvEnum.MorphOp.Tophat, AAA, New Point (1, 1), 1,  Emgu.CV.CvEnum.BorderType.Default, new Mcvscalar (255, 0, 0, 255));


Where the mat class above is used to define the size and shape of the kernel, in general, the value in size is twice times plus 1 for the point.

1. Open

Open operation is to the image first corrosion and then expand, you can exclude small groups of the object conversion formula is:

: (pictured on the left)

2.Close

Closed operation is the first expansion of the image and then corrosion, can be ruled out small black holes, the transformation of the formula:

: (pictured on the left)

3, Gradient

Return the picture is the difference between the expansion chart and the corrosion diagram, you can retain the edge contour of the object, the transformation formula is:

: (pictured on the left)

4, Tophat

The return image is the difference between the original image and the open operation result graph, and the transformation formula:

: (pictured on the left)

5, Blackhat

Returns the difference between the closed operation result graph and the original image, and the transformation formula is:

: (pictured on the left)

EMGUCV functions in the image Class (ii) Use MORPHOLOGYEX for more 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.