Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
285 views
in Technique[技术] by (71.8m points)

c++ - detect quite brighter spots on the image

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:

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:

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

enter image description here

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

enter image description here

Keywords: Image processing, unsharp mask, uneven lighting.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...