LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Fire Detection program for thermal imaging camera (https://www.linuxquestions.org/questions/linux-software-2/fire-detection-program-for-thermal-imaging-camera-4175586749/)

aquamarine 08-10-2016 11:48 AM

Fire Detection program for thermal imaging camera
 
Hi,
I am newbie and trying to write a source code for fire detection system for a thermal imaging IP camera.
I need help for writing a program in visual studio or in Eclipse for the said purpose.
if any body have an idea or source code in which he detect fire and alarm for thermal imaging IP camera then please let me know. I shall be very thankful to you.

Regards

timsoft 08-11-2016 08:51 AM

visual studio isn't exactly linux-software, but I found when trying to detect fire with an infra-red sensitive camera, that providing the camera is not exposed to sunlight or other direct heat sources or reflectors, then if the camera has auto-brighness control built in, any flames are usually completely saturated in an image. you can do image threshholding, then look for "white" pixels. imagemagick and some scripting can do this for you. (it is available cross platform, but I have only used in in linux.)
convert imagename.jpg -threshold 98% jpg:- |stream -map i -storge-type char jpg:- -|detect_saturated_pixel
works, where detect_saturated_pixel is a binary that reads stdin and prints a message if a saturated pixel (255) is found. you will need to adjust the thresholding, and you will have to write the detect_saturated_pixel program yourself, but my own version is less than 30 lines long, so it isn't too hard.
you may have to mask part of the picture, and that can be done using imagemagick commands as well.
If your thermal camera has calibrated fixed exposure, you should be able to find out the temperature that a pixel brightness indicates, and then decide what is "fire" and what is not using that. That is even easier. Just bear in mind my comments about the sun and sunlight. That will max out any camera sensor as the sun is very hot :-)

aquamarine 08-12-2016 11:00 AM

Quote:

Originally Posted by timsoft (Post 5589395)
visual studio isn't exactly linux-software, but I found when trying to detect fire with an infra-red sensitive camera, that providing the camera is not exposed to sunlight or other direct heat sources or reflectors, then if the camera has auto-brighness control built in, any flames are usually completely saturated in an image. you can do image threshholding, then look for "white" pixels. imagemagick and some scripting can do this for you. (it is available cross platform, but I have only used in in linux.)
convert imagename.jpg -threshold 98% jpg:- |stream -map i -storge-type char jpg:- -|detect_saturated_pixel
works, where detect_saturated_pixel is a binary that reads stdin and prints a message if a saturated pixel (255) is found. you will need to adjust the thresholding, and you will have to write the detect_saturated_pixel program yourself, but my own version is less than 30 lines long, so it isn't too hard.
you may have to mask part of the picture, and that can be done using imagemagick commands as well.
If your thermal camera has calibrated fixed exposure, you should be able to find out the temperature that a pixel brightness indicates, and then decide what is "fire" and what is not using that. That is even easier. Just bear in mind my comments about the sun and sunlight. That will max out any camera sensor as the sun is very hot :-)

Thank you for your reply and Sorry for miscommunication e.g. visual studio.
Actually i need some help for writing the said program. A software which detect fire using a thermal image IP camera and play Alarm. this is my objective. I have a thermal image camera, its range is 6km. I need software code either in Visual studio (windows based) or any other language in other OS e.g Linux etc..
Thanks

rtmistler 08-12-2016 12:33 PM

Quote:

Originally Posted by aquamarine (Post 5589888)
Thank you for your reply and Sorry for miscommunication e.g. visual studio.
Actually i need some help for writing the said program. A software which detect fire using a thermal image IP camera and play Alarm. this is my objective. I have a thermal image camera, its range is 6km. I need software code either in Visual studio (windows based) or any other language in other OS e.g Linux etc..
Thanks

People here will help you to accomplish writing this code; however you need to recognize a few things. First you are saying you have no code and just want example code. Please perform a web search. Given that the purpose of this code is somewhat unusual, you may have to search for similar techniques and then modify the code you do find to be adapted for what you want it to do. If you illustrate that you've done some of your own code, people will be more willing to offer suggestions to how to continue with your project.

Next, you describe what you want it to do. It sounds very open-ended, and unclear, meanwhile it sounds interesting and very involved. To me, if this was an actual project where I'd be quoting it, I'd want to see a product requirements specification. If the asking person did not have any requirements document I'd volunteer to work with them to derive that document before implementing their request, because one never knows how those requirements may change.

Only you know how critical this project is. For instance if it is a product you envision and wish to make money with, if it is a school project where you wish to excel at, or if it is just personal exploration which you wish to perform. For any of those cases though, you really should be putting in sufficient effort on your own to define what you want and then attempting to implement what you want versus asking for pure hand-outs. If you know now that you are incapable of the high level of development that such a project may require, then you ought to be prepared to seek funding and assistance where you invest time and money to get this project accomplished.

TB0ne 08-12-2016 12:40 PM

And to add to what rtmistler said, unless this is for a school assignment/demo project, it would be near impossible to implement in the real world as an accurate alarm. For example, localized heat sources (stoves? hot-plates? coffee makers?) will set it off. How about duration of the heat source? Someone lighting a cigarette? A candle? False-positive. While you can give it very broad parameters as a demo, the 'smarts' you'd have to put in the box in the real-world would make it HUGELY expensive, and require a good amount of user setup.

John VV 08-12-2016 05:22 PM

have a look at OpenCV
http://opencv.org/
there are a ton of already done things and in many languages
ranging from c,c++ to matlab and python

timsoft 08-12-2016 06:15 PM

I have a system which detects fire but it is only in a confined space (a boiler room) where the variables and factors are quite limited, and can be confused by bright lights in un-planned locations. For an outdoors project, it is a much more challenging job, and very well described by rtmistler. If this is a hobby application you can try simple thresh-holding, but for a commercial project it can get complex. see http://cordis.europa.eu/result/rcn/143051_en.html for complex, or for a camera that claims to do it all for you, http://vumii.com/fire-detection/
you haven't indicated if the camera will be moving or stationary, and taking stills or video, all of which affect your options. You also haven't said how proficient you are at c/c++ programming which is likely to be required if you are coding image processing yourself and want it to be quick.
If you are truly a newbie, I would try capturing images from the camera first, and then go from there. Break down the project into smaller parts which you can manage, but expect to do a lot of learning and coding. often it takes time learning one approach, only to find it will not do what you want for your parameters. no-one can do that research for you, but experience will be gained by going through the process, and you will become more realistic in your expectations of yourself, and have learned about a bunch of different systems as well by the time you finish.


All times are GMT -5. The time now is 05:46 PM.