I am currently doing a project in which I am trying to identify humans based on hands vascular pattern in C# using Emgu CV. The gray-scale image of the hand was first processed using the Adaptive Threshold function. Now I want to create a mask of the image using the morphological operations. The purpose is to remove the noise from the image. This is the adaptive-thresholded image:
Kindly guide me which function should I use and how to use.
The code here is in C++. It shouldn't be difficult to port to C#, since it's mostly OpenCV functions calls. You can use that as guideline. Sorry about that.
You can apply a open operation with a small kernel to remove most of the noise:
As you can see, some noise is still present, and you can't remove it with other morphological operations. You can simply consider the largest blob as the correct one (in green here):
Then you can floodfill the inside of the hand (in gray here):
And set to 0 all values in original image where the corresponding mask in not the same color of the inside of the image:
This is the full code (again, it's C++):