How to identify regions of heat in thermal images?

6

I'm developing a project where I need to process photos taken from a thermal camera. The idea is to try to identify fires in these images. I would like to know what techniques I can use for this purpose, if they know anything, or something that can help me.

    
asked by anonymous 08.03.2014 / 18:32

3 answers

20

Although you have decided to answer this question, I believe in questions of computer vision and image processing, the person asking you should show how they have tried to solve the problem: list / describe the techniques you applied to try solve the problem, or show code that does this . So the question becomes specific and it does not run the risk of being closed.

To avoid a very long post , this answer assumes that the reader has a basic understanding of the digital image processing area.

The image below was acquired by a thermal imaging device that was being used by Firefighters during a training .

The capture device has a sensor that can indicate the approximate temperature of the central region of the image. The green bar that appears on the right side of the image accuses the temperature of the red region is above 900 degrees. In this way, we can assume that regions with more heat in the image will have stronger colors.

The algorithm I describe here uses the following pipeline processing:

  • Thresholding
  • Contour detection

The problem can be solved by applying a threshold threshold ) to isolate pixels that have a certain color tone, in this case red. This operation produces the following binary image:

Then identify the contours of objects in the binary image makes it possible to locate the areas hotter. The result of this operation is an array with the object outlines:

Thisseemstobeexactlywhatyouarelookingfor.Wecanalsousethisdatatovisualizeintheoriginalimagetheareathatwasdetectedbythealgorithm:

This approach presents a simpler way of solving the problem. Note that for a more robust solution you should test it with a larger set of images. Be prepared to make adjustments and improve this solution.

There is a programming library that implements the techniques I mentioned above. I'm talking about OpenCV , which is the largest open source library of computer vision. It is cross-platform and has APIs for the C, C ++, Java and Python languages.

Good luck!

    
10.04.2014 / 14:23
9

The user @karlphillip already provided an excellent answer, but I wanted to complement with some comments and suggestions but the comment field was small. So I decided to add my own answer.

The idea of using thresholding makes perfect sense, especially for examples like those given in Karl's answer. However, the person who asked the question (@ user6357) did not provide even an image of your problem domain, so it is difficult to provide really concrete suggestions. So, I unfortunately agree with Karl on the fact that the question is quite badly made. But regardless of the quality of the question, I think the knowledge put here can help the community and so I preferred to collaborate rather than simply flag the question.

Assuming that the images captured by the camera do not have a background as different from red as the example provided in the cited response, the use of the threshold alone may not give satisfactory results.

In this way, I imagine two alternatives:

1. Add to the thresholding (or any other targeting method) a preprocessing that considers only areas of the image where there is movement.

If you have control over capturing images from the camera (this is also something that you did not mention in the question) and you are able to take two images in sequence, you can compare the images to verify the differences: a mere subtraction of the images. values of the pixels between the images will produce a new image whose pixels will be nonzero in the regions where motion occurs. In your question you mention "fires", and the crackle of fire naturally causes movement. If this is the case, it should be possible to pre-segment the image only in areas where movement occurs to then apply the pipeline suggested by Karl.

There are other solutions with more complex classifiers that also use the movement as well as the texture analysis for the detection of fires. This article is a great example that you may find useful.

2. Use a more complex classifier.

Assuming you have no image sequences, ie only a single image to perform the detection and that due to background variations the use of thresholding is insufficient. In this case, you can try with more robust classifiers.

Since you're using C ++ (and I've already suggested OpenCV, which is a fantastic library), I'd suggest using Cascade Classifier . You will need to train your own classifier with positive example images (where there are fire outbreaks) and negative (where there are no fire outbreaks), and this tutorial is really cool to do this (it detects bananas in images, but the principle is the same - just use examples correct, hehehe).

This classifier works quite intelligently: Basically, during training it "learns" from example images the light intensity values for different types of characteristics (#) that indicate when there is a chance that the object of interest exists in a certain area of the image. Because these features are easily scaled, it is easy to look at the image for variations in size (scale) of the same object - and in practice that is what the algorithm does: it looks in windows of gradually larger size until the classifier indicates as true the occurrence of an object in one of the search windows.

The features that OpenCV uses in existing implementations are those of the following image, which I believe should be sufficient for your type of problem.

The OpenCV site's own link description is pretty cool, but you do not have to fully understand the idea of this classifier to use it. The quality of the detection will only depend on the quality of the samples you provide. In the tutorial I quoted examples of bananas are all horizontal, so that the resulting classifier may not be very robust for images with banana photos vertically. Similar variations can influence your result, so just be aware of the possibility of having to retrain with more examples.

    
12.04.2014 / 04:47
1

I have no experience with the subject but I know that OpenCV is widely used for image processing, and in the case of a thermal camera, I imagine hotter areas than normal are highlighted in the appropriately-colored, less-than-normal images, so rendering a color treatment of images via OpenCV seems like an option.

This is a reference regarding using OpenCV for fire and smoke detection (in this case, it seems to use even ordinary cameras): FIRE AND SMOKE DETECTION BASED ON LOW COST CAMERA

    
08.03.2014 / 18:59