Flame Detection System
This project is an imcomplete implemention of a video-based multi-feature flame detection system, and it's my graduation design.
When I began the study of this subject, I found a lot of articles and very little code on the Internet. So when I finally finished it, I decided to make it open source.
Note that, this project is not ready for practical application. Due to limited time spent on this project, the code is only partially optimized. However, the response time is totally acceptable when testing on my Mac.
This project is built with Xcode 5.0.2 on Mac OS X 10.9.3, and it's implemented with OpenCV 2.4.8.
Because it doesn't use any native interface of a specific platform, it can be easily ported to other platforms, such as windows, linux, android, etc.
If you want to use the save-video feature, you need to make sure your OpenCV is compiled with FFMPEG support, if not, compile it by yourself.
The following two images show the result.
First, segment the input image with color detection and motion detection, and extract candidate flame regions.
- Use Gaussian mixture model for background modeling to detect motion pixels.
- Use a flame color model based on RGB and HSV color space to detect pixels which have flame-like color.
- Take the intersection of the results of the above two steps to get candidate regions.
- For the problem of noise and incomplete target, apply serveral denoising and target completion algorithms to the candidate regions.
- Divide the candidate region into targets, and use multi-target tracking algorithm to identify the same target in different frames.
Then, extract some static and dynamic features from the flame.
- Static features are described in three aspects: color, geometry and texture.
- Dynamic features are described in two aspects: whole motion and random motion.
Finally, use a support vector machine for flame recognition, which consists of two parts: training and prediction.
Files and Folders
FlameDetectionfolder contains all the C++ code.
clipsfolder contains some video clips for testing, which is mainly downloaded from here.
samplesfolder contains some data samples which can be used as SVM input.
testfolder contains only one script which plot the DFT results with matplotlib.
Tested on MacBook Pro MC721CH/A, with processor Intel Core i7 2630QM, clocked at 2GHz, Turbo 2.9GHz and 8GB memory size.
clips/6.avi to test the response time.
|Total Frames||Min Process Time||Max Process Time||Average Process Time|
Use three clips to test the detection rate.
|Video Files||Total Frames||Detected Frames||Detection Rate|
DO NOT MAIL ME FOR NON-ALGORITHMIC QUESTIONS.