I have this image:
I am trying to find the spots (defects) as shown in the image. I have tried thresholding, but that only helps for the really bright ones. Any suggestions on how to do it?
I have this image:
I am trying to find the spots (defects) as shown in the image. I have tried thresholding, but that only helps for the really bright ones. Any suggestions on how to do it?
I don't know which threshold did you use for your image, but it seems that your image is noisy and in Black and white colors. My suggestion is to use noise removal methods such as Morphological operators before applying threshoulding ("Opening" removes small objects, while "closing" removes small holes depend on you noise type). another suggestion of mine is using mean or median filters to avoid noises then apply threshoulding.
Your image is highly structured, and I think that given the difficulty of the problem (i.e. wanting to remove both light and dark spots, and the subtle nature of some of these) you will have to exploit that. Specifically, your image appears to consist of multiple 'traces', where each trace at a given point in time has a gaussian luminance profile. In some traces, e.g. #4 but less so in #3, there is considerable jitter. So I would divide the image into five horizontal strips centered on the trace, and then fit the luminance function to a time-varying gaussian function. I.e. divide each strip vertically into many thin vertical strips and fit a gaussian to these. (These vertical strips can overlap.)
Once you have this, you can generate a 'model' image which should look like a super-clean version of the original (but which will retain all its structure). Then go and remove those points from the original which deviate from the model by some absolute threshold. Replace them with model or interpolated values, and you're done. This is a bit of work but if your data is consistently structured as it appears to be this should do it.