Firstly, I think Gaussian thresholding to be the suitable choice to binarize these images based on what I've read, that they are "useful for images with variable lightning conditions". If you think some other method is more suitable please let me know.
I have tried to apply adaptive thresholding on this image
filter4_result = cv2.adaptiveThreshold(filter3_result, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY_INV, block_size=5, constant=20)
and this is the result that I am getting. As you can see, it detects the bird as a single blob but also detects some slightly dark spots on the bottom left and right. Do you think it's possible to have a set of parameter values in adaptive thresholding that I can apply to segment only the bird?
and if I should use some other technique than adaptive thresholding, which one should I go for?
I have also tried Otsu thresholding with the following statement and this is the result that I got with Otsu thresholding
filter4_result=cv2.threshold(filter3_result,128,255,cv2.THRESH_BINARY_INV+cv2.THRESH_OTSU)
Otsu thresholding excludes all the noise nicely but it breaks apart the bird into several individual blobs.
Isn't there a sweet spot that I can achieve with any of the methods where I only detect the bird and nothing else on the image? I don't even need a well defined outline of the bird. If it can just count each bird correctly, that would still be good enough.
Which thresholding method and correspondingly what parameter values should I use to achieve that?