I have a bit noisy image where the background is not homogeneous. The image contains brigther convex spots, and I need to detect them.
Here's a link for an example image:
![](https://www.manongdao.com/static/images/pcload.jpg)
I know there is a lot of circle detection algorithm, but the difference between the environment and the object is too small.
Do you any suggestion, how to segment the brigther spot? Or any idea to increase the intensity difference between them?
update:
the OpenCV environment is C++. I tried the adaptive threshold with many parameters. Here's the result:
![](https://www.manongdao.com/static/images/pcload.jpg)
It is not bad, but the image contains a lot of other black spots. And sometimes the spots area near the same as the object, so in that way I can't distinguish later.
Generally, the technique is to blur the image so that small-scale details become irrelevant and only large-scale differences in the background illumination are retained. You then subtract the blurred image from the original to remove the uneven illumination, leaving only the localised features visible.
My preferred tool is ImageMagick, but the principle is the same in OpenCV. Here I clone your original image, blur it over 8 pixels and then subtract the blurred image from the original:
convert http://s8.postimg.org/to03oxzyd/example_image.png \( +clone -blur 0x8 \) -compose difference -composite -auto-level out.jpg
![](https://www.manongdao.com/static/images/pcload.jpg)
And here I blur over 32 pixels, and subtract the blurred image from the original:
convert http://s8.postimg.org/to03oxzyd/example_image.png \( +clone -blur 0x32 \) -compose difference -composite -auto-level out32.jpg
![](https://www.manongdao.com/static/images/pcload.jpg)
To increase the image contrast you may take a look at histogram equalization technique.
Based on image histogram it will redistribute the image's pixel intensity values in the way that areas of low contrast can gain higher contrast. Then intensity-thresholding operations performed on your image may produce better results. For refference take a look at:
http://en.wikipedia.org/wiki/Histogram_equalization
There is also OpenCV implementation of this operation:
void equalizeHist(InputArray src, OutputArray dst)
And tutorial: http://docs.opencv.org/doc/tutorials/imgproc/histograms/histogram_equalization/histogram_equalization.html