当前位置:网站首页>[Fire Detection] forest fire detection system based on Matlab GUI (with panel) [including Matlab source code phase 1921]
[Fire Detection] forest fire detection system based on Matlab GUI (with panel) [including Matlab source code phase 1921]
2022-06-29 01:07:00 【Poseidon light】
One 、 Introduction to fire detection
1 introduction
At present, forest fire is one of the most important disasters that destroy forests , Great influence . The forest is home to all kinds of rare birds and animals , After the forest fire , It will destroy the environment on which wild animals live . Serious forest fires can not only cause soil erosion , It will also cause flash floods 、 Debris flow and other natural disasters . therefore , Early identification and early warning of forest fires , Can minimize the loss . This forest fire detection method is based on the study of the general characteristics of fireworks by using image processing technology , Combine the color of the flame in the pyrotechnic area 、 area 、 Irregularity, color and dynamic characteristics of smoke . Basically eliminate other adverse effects , Effectively improve the accuracy of forest fire image recognition . besides , We use the method of multi-layer detection , Reduce the time of system processing and analysis , It improves the recognition speed .
chart 1 Fire identification process
2 Forest fire detection system process
In order to achieve the purpose of fire detection , We use smoke and flame to detect , A multi-layer extended recognition process is designed , The combination of static features and dynamic features . The overall process of the specific operation of the scheme is shown in the figure 1. The overall design idea of the fire detection system is : The first step is to acquire the real-time image taken by the camera ; Then the real-time background difference of the video image is used to dynamically judge whether there is any abnormality , If several consecutive frames of images have changed greatly , That is, it is judged that there is an abnormal situation ; Next, we use our detection algorithm to recognize the flame and smoke respectively , If there is a flame in the image ( smoke ) , The system will output “1”, Otherwise output “0”; Finally, we use our multi feature fusion to comprehensively judge whether it is a fire , If yes, output “1” Give fire warning , So as to complete the whole forest fire detection system .
3 Flame detection
The flow chart of the flame detection part of the forest fire risk detection system is shown in the figure 2 ( Left ) Shown :
chart 2 Flame detection ( Left ) And smoke detection ( Right ) flow chart
After the image to be detected is input , Initial image processing is required . The image preprocessing process generally includes enhancement 、 wave filtering 、 Refine several aspects . Next, the enhancement and filtering of flame image are briefly described .
Image enhancement mainly refers to enhancing a part of an image according to the idea of the developer , It can be a specific area , It can also be part of the area that meets the relevant restrictions , And the processing method of diluting or eliminating some unimportant and disordered information . Image enhancement mainly includes histogram modification 、 Image smoothing 、 Common processing methods such as image sharpening and color image processing . We use several methods to synchronize the system , The purpose is to achieve the desired enhancement effect of the flame image .
After the flame image is preprocessed , The next step is to split the flame . In sufficient natural light , We adopt the method of color feature extraction , Divide the suspected flame area from the figure . In general , Although the flame may have many different colors , But mainly concentrated in dark red 、 Red 、 Orange 、 yellow 、 white 、 Blue is one of these colors . Even in different environments, the flame will show different colors , But it often goes through the combustion process from red to yellow . At this time, the RGB The value corresponds to R≥G≥B The relationship between . meanwhile , We take the switch to HSI Space , Carry out multi feature acquisition . stay HSI In the space , Chromaticity value of flame H Usually in 0~60 Between degrees , Besides , S Satisfy 100, I Satisfy 255. The pixels in the image that meet the above four conditions are regarded as candidate regions for flame .
There may be noise in the image after extracting the color of the flame , We use median filter to remove noise .
stay (Y, Cr, Cb) In the space , There are obvious differences between flame and other related objects . In 2D (Cr, Cb) In space , The distribution of flame pixels is close to normal distribution , Other objects do not have this property . So we take the flame image to (Y, Cr, Cb) Space , Analyze pixels , Extract the regions close to the normal distribution .
in other words , When the detection image is in the two-dimensional (Cr, Cb) When the space satisfies the normal distribution , Can be roughly judged as flame image .
After rough judgment of flame color characteristics , The next step is to determine the dynamic characteristics of the flame , The final decision is whether it is flame . For humans , Shape is an important feature for us to judge an object . So the computer is also very useful for analyzing the shape of the object in the image . According to the relevant theories of graphics and images , We get the dynamic features of the flame image , Take this as the basis for judgment for further processing . We use two characteristics related to the shape of the object as the basis for judging the flame image .
A. Irregularity
Considering the irregularity of forest fire flame shape and the image light source that may interfere with our system ( Like a flashlight , Searchlights, etc ) The shape feature of has the characteristics of high regularity , We use the degree of irregularity as the basis for judging whether it is a flame . The degree of irregularity represents the degree of irregularity of the shape of an object , Its expression is as follows :
We define the perimeter as the boundary length of the object , It can be obtained by the number of pixels on the boundary of the candidate region of the flame image . The area is obtained by counting the number of pixels in all possible smoke areas . The more complex the shape of the candidate image , The larger the irregularity value is .
The specific steps of obtaining the irregularity of the flame candidate image :
(1) The edge of the flame candidate image obtained by color segmentation is extracted , Calculate the number of pixels on the edge to get L.
(2) Calculate the area of the suspected flame area in the flame image , That is, calculate the total number of pixels set to black in the previous color segmentation S.
(3) Find the irregularity , And calculate the continuous n Average value of frame image .
B. Diffusivity
Usually after a fire , The fire area will show a growing trend , The burned area will continue to expand , The fire area detected by the corresponding camera will also gradually increase . That is to say, the highlighted areas in the images we get will continue to grow . therefore , We can define “k” It represents the ratio of the area of the subsequent suspected flame area to the area of the previous suspected flame area to characterize the diffusion characteristics of the fire . Within the reference time we set , k The bigger the value is. , The stronger the diffusion characteristic of fire .
In the flame detection section , First, the image is pre processed , The candidate images of flame region are screened based on color features , Then, according to the irregularity and diffusivity of these images, the final judgment of whether it is a flame area is made , Then input the decision result to the next step .
Two 、 Partial source code
function varargout = MainGUI(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @MainGUI_OpeningFcn, ...
'gui_OutputFcn', @MainGUI_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{
1})
gui_State.gui_Callback = str2func(varargin{
1});
end
if nargout
[varargout{
1:nargout}] = gui_mainfcn(gui_State, varargin{
:});
else
gui_mainfcn(gui_State, varargin{
:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before MainGUI is made visible.
function MainGUI_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to MainGUI (see VARARGIN)
% Choose default command line output for MainGUI
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes MainGUI wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% Hide some controls when running the main interface
% set(handles.axes1,'visible','off');
% set(handles.text1,'visible','off');
% --- Outputs from this function are returned to the commandline.
function varargout = MainGUI_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{
1} = handles.output;
% --- Executes on button press in openvideo_button.
function openvideo_button_Callback
% hObject handle to openvideo_button (see GCBO)(hObject, eventdata, handles)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Read video path
[filename,pathname,filter] = uigetfile({
'*.mp4;*.flv;*.avi;*.rmvb;*.f4v;*.mpeg;*.mkv'},' Choose video ');
if filter == 0
return
end
str = fullfile(pathname,filename);
% Read video
filename = str;
% obj It's an object
obj = VideoReader(filename);
% The preview of the first frame of the video is displayed on the interface
Show_Frames=read(obj,1);
axes(handles.axes1);
imshow(Show_Frames);
set(handles.axes1,'visible','on');
axis off
3、 ... and 、 Running results

Four 、matlab Edition and references
1 matlab edition
2014a
2 reference
[1] Cai Limei .MATLAB The image processing —— theory 、 Algorithm and example analysis [M]. tsinghua university press ,2020.
[2] Yang Dan , Zhao Haibin , Long Zhe .MATLAB Detailed explanation of image processing examples [M]. tsinghua university press ,2013.
[3] Zhou pin .MATLAB Image processing and graphical user interface design [M]. tsinghua university press ,2013.
[4] Liu Chenglong . Master MATLAB The image processing [M]. tsinghua university press ,2015.
[5] Yangyuzhuo . Forest fire detection system based on image processing [J]. Electronic world . 2018,(16)
3 remarks
This part of the introduction is taken from the Internet , For reference only , If infringement , Contact deletion
边栏推荐
- It is safer for individuals to choose a securities company to open an account when buying interbank certificates of deposit
- 674. longest continuous increasing sequence
- [SV basics] some usage of queue
- Operation level smart campus system source code smart campus applet source code + electronic class card + face recognition system
- Browser cache library design summary (localstorage/indexeddb)
- 启牛学堂帮忙开证券账户是安全靠谱的吗?个人如何开
- 深度优先搜索实现抓牛问题
- [staff] accent mark, gradually stronger mark and gradually weaker mark
- What is contemporaneous group analysis? Teach you to use SQL to handle
- Program environment and pretreatment
猜你喜欢

EasyCVR新建用户后,视频调阅页面不能点击的问题修复

How to mount FSS object storage locally

Jbridge bridging frame technology for AI computing power landing

How to calculate the income tax of foreign-funded enterprises

旋转接头安装使用注意事项

Accessories and working process of machine vision system

【图像处理】基于matlab实现图像曲线调整系统

Easycvr service private What should I do if the PEM file is emptied and cannot be started normally?

After easycvr creates a new user, the video access page cannot be clicked. Fix the problem

使用.Net驱动Jetson Nano的OLED显示屏
随机推荐
QT基於RFID管理系統(可應用於大多數RFID管理系統)
【UVM】我的 main_phase 都跑完了,为啥 case 无法退出?太不讲道理!
广度度优先搜索实现抓牛问题
Sampling with VerilogA module
Structure of the actual combat battalion | module 5
立创eda学习笔记:铺铜死区?孤岛?死铜?
SRAM和DRAM之间的异同
What is the difference between immunohistochemistry and immunohistochemistry?
Redis常用命令手册
Accessories and working process of machine vision system
EasyCVR播放视频出现卡顿花屏时如何解决?
基于.NetCore开发博客项目 StarBlog - (13) 加入友情链接功能
How to handle a SIGTERM - how to handle a SIGTERM
GUI Graphical user interface programming example - color selection box
[agile 5.1] core of planning: user stories
Operation level smart campus system source code smart campus applet source code + electronic class card + face recognition system
Oracle uses sqlloader to prompt sql*loader-406 Import failed but no error was reported
深度优先搜索实现抓牛问题
Breadth first search to catch cattle
【leetcode】153. Find the lowest value in the rotation sort array