I require ideas to detect these kind of black spots in a gray scale image.
I have tried applying Canny and Sobel edge detectors (with various thresholds) but didn't get good results. There's a lot of noise.
Visually, there's stark difference between the bottle and the black hole. But the log filter output doesn't show this high difference. Moreover, only the small boundary around the hole is detected. (FYI: the drop kind of shape on the left shouldn't be detected since it's not a defect.)
Is there any other method I can use?
I have attached the gray scale image.
This is the output of imadjust(GrayImg). What function can I use to find the encircled regions?
Kindly note that I am able to segment the bottle. So basically, I am ignoring the top and bottom 300 rows, and left and right 100 columns in all images.