All transformations in the Morphologyex are as shown
Call Method:
[CSharp]View PlainCopyprint?
- Mat AAA = Cvinvoke.getstructuringelement (Emgu.CV.CvEnum.ElementShape.Rectangle, new Size (5, 5), new Point (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