4

I'm trying to use OpenCV to detect IR point using in-built camera. My camera can see infrared light. However I don't have a clue how to distinguish between visible light and IR light. After transformation to RGB we can't distinguish, but maybe OpenCV has some methods to do it.

Does anybody know about such OpenCV functions? Or how to do it in other way?

--edit

Is it possible to recognise for example light wavelength using laptop in-build camera ? Or it's just impossible to distinguish between visible and infrared light without using special camera?

Zbigniew Wazeliniak
  • 1,101
  • 2
  • 8
  • 9

3 Answers3

2

You wouldn't be able do anything in OpenCV because by the time it goes to work on it, it will just be another RGB like the visible light (you sort of mention this).

You say your camera can see infrared...Does this mean it has a filter which separates IR light from the visible light? In which case by the time you have your image inside OpenCV you would be only focusing on IR. Then look at intensities etc?

Science_Fiction
  • 3,403
  • 23
  • 27
1

In your setting, assuming you have RGB +IR camera, probably your camera will display these three channels:

  • R + IR
  • G + IR
  • B + IR

So it would be difficult to identify IR pixels directly from the image. But nothing is impossible. R, G, B and IR are broad bands so information on all wavelengths is in the channels.

One thing You can do is to train classification model to classify non-IR and IR pixels in an image with lots of image data with pre-determined classes. With that model trained, you could identify IR pixels of new image.

Tae-Sung Shin
  • 20,215
  • 33
  • 138
  • 240
  • The whole suggestion about a classification model indicates that there is correlation between IR data and individual RGB channels. It might be for, say, human face but it will be too generic to be useful. The only solution here is to get different hardware that captures IR – Rajiv Feb 01 '21 at 17:03
0

There is no way to separate IR from visible light with software, because your camera in fact "transforms" IR light into for your eyes visible light. I assume the only way to solve that would be using 2 cameras, one IR camera with IR-transmitting filter and one normal camera with IR blocking filter. Then you can match the images and pull out the information you need.

Lukas Thanei
  • 169
  • 6
  • As I just found out thanks to another response, there are already combined cameras available, which deliver both images (respectively a 4th channel) – Lukas Thanei Jan 31 '13 at 10:00