Detects rather bright spots in the image

I have a slightly noisy image where the background is not uniform. The image contains shorter raised spots and I need to detect them. Here's a link for an example image:

I know there are many circle detection algorithms, but the difference between environment and object is too small. Do you have any suggestion on how to segment a larger space? Or any idea to increase the difference in intensity between the two?

update:

OpenCV environment is C ++. I tried adaptive threshold with many parameters. Here's the result:

This is not bad, but the image contains many other black spots. And sometimes the spot area is close to the object, so I can't distinguish later.

+3


source to share


2 answers


Typically, the technique is to blur the image so that small-scale details become irrelevant and only large-scale differences in background lighting are retained. Then subtract the blurred image from the original to remove uneven lighting, leaving only localized features visible.

My preferred tool is ImageMagick, but the principle is the same in OpenCV. Here I am cloning your original image, blurring it 8px, and then subtracting 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

      

enter image description here



And so I blur 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

      

enter image description here

+3


source


To increase the contrast of an image, you can take a look at the histogram equalization method .

Based on the image histogram, it will propagate the pixel intensity values โ€‹โ€‹of the image so that areas of low contrast can get higher contrast. Then intensification operations performed on your image may give better results. For recap take a look at: http://en.wikipedia.org/wiki/Histogram_equalization

There is also an OpenCV implementation of this operation:



void equalizeHist(InputArray src, OutputArray dst)

      

And a tutorial: http://docs.opencv.org/doc/tutorials/imgproc/histograms/histogram_equalization/histogram_equalization.html

-2


source







All Articles