In this post we will see how the blob detection feature I implemented in one my previous posts can be useful to implement the features I'd like to achieve, namely flames detection
A flame is not an efficient means to light your house: it emits most of its energy in the infrared spectrum, that is to say it emits light with such a long wavelength that human eye can not see it. So, to detect a flame the easiest way is to look for a source of infrared radiation.
Normal cameras have a built-in infrared filter (placed just in front of the CCD or CMOS sensor) that prevents infrared radiation from overlapping red radiation in the visible spectrum.
To implement an infrared camera, it would be required to remove such a filter, but this operation is very difficult to work out without breaking up the tiny CCD or CMOS sensor.
Thanks to RaspiCam's engineers, a RaspiCam without the IR filter is available off-the-shelf: it is branded as RaspiCam NoIR (where NoIR obviously means "no IR filter").
This version of the RaspiCam basically can see a certain range of the infrared radiation (called near-infrared, that is to say to the part of the infrared spectrum that is closed to the visible spectrum) in the Red channel of the sensor. This means that the red component of the visible light is superseded by the near-infrared radiation.
Long story short: for the purposes of flame detection, I can extract the Red channel of the camera-captured image to detect sources of infrared radiations, also called a "flame".
I made some test with the fire coming from a lighter at different distances and different light conditions. This is an example of a picture taken with the Raspicam NoIR
To detect a flame, I need to detect a blob whose color is in the range from RGB color (220, 220, 220) to RGB color (255, 255, 255)
With these thresholds set, the algorithm works as I show in the video I published with my previous post
Thanks for reading and have a nice day!!