How to detect Hotspots in an image
Asked Answered
L

1

10

How to detect a hotspot in an image using opencv? I have tried googling but couldnt get a clue of it.

Description: I need to filter good images from a live video stream. In this case I need to just detect the Hotspot in a frame. I need to do this in opencv.

What is HotSpot?

Hot spots are shiny areas on a subject’s face which are caused by a flash reflecting off a shiny surface or by uneven lighting. It tends to make the subject look as if they are sweating, which is not a good look.

Update : http://answers.opencv.org/question/7223/hotspots-in-an-image/ http://en.wikipedia.org/wiki/Specular_highlight

The above two links also could help for my Post?

Image with HotSpot:

enter image description here

Image Without HotSpot:

enter image description here

Lehmbruck answered 11/2, 2013 at 9:45 Comment(7)
@Ben Hot spots are shiny areas on a subject’s face which are caused by a flash reflecting off a shiny surface or by uneven lighting. It tends to make the subject look as if they are sweating, which is not a good look.Lehmbruck
Try searching for 'highlight detection' instead.Stribling
A basic gaussian filtering with a crude threshold could do it. But the question is so badly specified that it should be closed as it stands.Perineurium
@Perineurium Thanks for your reply. Can you please explain a bit more. So that I could try to implement it. Please..Lehmbruck
Can you post some example images?Goya
@MrE I have updated my question with some images. Please have a look.Lehmbruck
See also: [Using python PIL to turn a RGB image into a pure black and white image ](https://mcmap.net/q/223325/-using-pil-to-turn-a-rgb-image-into-a-pure-black-and-white-image) and Specular highlights positionLynch
P
9

An automatic rough indication of these "hotspot" areas can be obtained by a gaussian filtering followed by a binarization. The expectation is that the "hotspot" is much brighter than the area around it, so after a gaussian filtering they will be at least slightly highlighted and, at the same time, image artifacts are reduced due to the nature of the low-pass filtering.

Example results follow. Binarization at 0.75 (range is always [0, 1]) after a simple conversion to grayscale, Binarization at 0.85 after a gaussian filtering in the B channel of the HSB colorspace:

enter image description here enter image description here

In both cases large components were removed due to the assumption that "hotspots" aren't too big.

Perineurium answered 11/2, 2013 at 17:42 Comment(7)
This method fails badly on many images. There are much better methods, e.g., see this: asiair.asia.edu.tw/ir/bitstream/310904400/19115/1/99052045.pdfParallax
@Perineurium : what is HSB colorspace? How is it different from HSV?Lyndy
@Shambool you are being fooled there just because it is a published paper. I've used YCbCr color space for skin detection, and it fails horribly very easily too. All you need is a photo where there is a bit more than the face region (note how this paper uses mostly only images that are faces under good conditions), a lot of of such photos contain colors that fools the method. The algorithm for determining bright area spots is purely an heuristic, so I have no idea why you think it is so superior. Anyway, this answer took me 30 seconds to write, so of course it can be improved (a lot).Perineurium
@AbidRahmanK I've seen it defined in different ways, see "Effect of Color Space In Image Indexing Based On Region CQ" and "Quantifying Turfgrass Color Using Digital Image Analysis" for examples of two papers presenting at least slightly different formulas. The way the second paper goes is very similar to the transformation to HSV as in en.wikipedia.org/wiki/HSL_and_HSV.Perineurium
@Shambool and mmgp. I would like to have your comments on my updated sectionLehmbruck
@Lehmbruck the paper about specularity removal is a good method to do what you are after, but please keep in mind there is no infallible method. It is also quite slow, this may or may not matter for you. Again, if it is not clear, there is no guarantee that any method will always give excellent results. For instance, i.imgur.com/A5Bov2Q.png is the specular free image by the method, and i.imgur.com/g45tHu8.png is the diffuse image (they are creepy, by the way) starting from the example image in the question.Perineurium
As for the research paper, unfortunately it won't help you much. The algorithms in recent research papers, particularly from the Asia Pacific region, are not very useful for practical work. They look slightly better on a standard dataset that somebody shared online, but fail equally when it comes to real world images.Guttle

© 2022 - 2024 — McMap. All rights reserved.