1 | initial version |
If you keep the shadow detection parameter as true, you'd get a gray area like this:
Threshold this image to remove the gray areas and make it black. As for removing the noise, you'll have to try different morphological operations like dialation and erosion to get rid of it. This is the result for the image above: