March 2019
Intermediate to advanced
538 pages
13h 38m
English
This transform extract finer details from the image as well. This is the difference between the morphological closing of an image and the image itself. This gives us the objects in the image that are smaller than the structuring element and darker than its surroundings:

Let's look at the function to perform a Black Hat transform:
Mat performBlackHat(Mat inputImage, int morphologyElement, int morphologySize){ Mat outputImage; int morphologyType; if(morphologyElement == 0) morphologyType = MORPH_RECT; else if(morphologyElement == 1) morphologyType = MORPH_CROSS; else if(morphologyElement == 2) morphologyType = MORPH_ELLIPSE; ...