detect quite brighter spots on the image

♀尐吖头ヾ 提交于 2019-11-29 05:14:55

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

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!