基于MATLAB的烟雾火灾检测识别系统

        火灾监测报警技术是预防火灾的重要手段。近年来, 火灾发生的频率高、覆盖范围广,给人民群众的生命财产 和社会经济造成了巨大损失,已成为一种普遍且损害巨大 的自然灾害。一旦引起火灾,火势将迅速蔓延,烟雾浓毒 性大,易造成人员伤亡,并且扑救火灾难度大,人员疏散 困难。因此,如何实现对火灾的实时有效监测已成为重点 研究的课题。 根据所探测物理量的不同,传统火灾探测器有感烟 式、感温式、感光式、和复合式等类型[1] ,但是这些火灾 探测器对于大空间的室内场合和开阔的室外环境的火灾 报警,探测结果受到很大影响,尤其在可靠性方面存在明 显不足。本文研究了基于MATLAB的火灾监测方法,与传统 的火灾监测技术相比,突破了空间的限制,能迅速获得较 准确的火灾监测结果。 

一、火焰特征分析

 1.1 火焰特征

        火焰的色彩特征在燃烧过程中比较明显,红色到黄色 范围内的色彩居多。火灾发生时,火焰区域与背景图像有 明显的视觉差异,火焰发光的现象在图像中的表现为火焰 的颜色偏红并且与周围的其它像素点相比亮度值明显偏 高,因此,在火灾的识别研究中通常利用火焰的颜色特征 进行判断。

1.2 RGB颜色模型

        RGB颜色模型也称为加色法混色模型。根据三基色原 理,用基色光单位来表示光的量。在RGB颜色模型,任意色 光F都可以用R、G、B三色不同分量的相加混合而成,表 达式为F=r[R]+g[G]+b[B]。当三基色分量都为0时,F为 黑色光;当三基色分量都为1时,F为白色光。RGB颜色模型 几乎包括了人类视力所能感知的所有颜色。RGB颜色空间 可以用如图1所示的立方体来描述。F是这个立方体坐标中 的一点,代表任一颜色,调整三色系数r、g、b中的任一系 数值就会改变F的坐标值,从而改变其色值。

1.3 提取火焰图像特征及分析

        对火焰模型特征提取时,通过收集的火焰模型是以 RGB模型在计算机中存储的,分析该模型非常有利于火 焰特征的提取。现对搜集到的18幅包含火焰的图像进行 分析,图像大约含像素点256.7万个,其中火焰像素点约 83.5万个。另有不包含火焰的图像8幅,图像大约包含像 素点117.8万个 。

二、算法描述

         针对传统火灾监测系统对于大空间的室内场合和开阔的室外环境易失效的问题,提出了一种结合火灾火 焰特征和烟雾特征来进行判断的数字图像型火灾监测算法。火焰颜色特征是基于RGB颜色模型中的R、G、B三基色分 量和它们之间的关系来判断是否有火焰发生,烟雾模型特征是图像灰度化预处理后,基于HIS空间模型提取的,通过计 算像素点与基准像素点之间距离D的大小来判断是否有火灾发生。对提出的算法进行MATLAB仿真,并和传统的基于 五种算子的边缘检测算法提取火焰烟雾特征进行对比。实验结果表明,提出的火焰特征和烟雾特征提取算法具有优越 性,时效性更好,能够实现快速高效的监测,解决了大空间场所火灾检测的难题。算法的流程图,

% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
axes(handles.axes1); %指定需要清空的坐标轴
cla reset;
box on;
set(handles.axes1,'xtick',[]);
set(handles.axes1,'ytick',[]);
axes(handles.axes2); %指定需要清空的坐标轴
cla reset;
box on; %在坐标轴四周加上边框
set(handles.axes2,'xtick',[]);
set(handles.axes2,'ytick',[]);
set(handles.edit1,'string','');
set(handles.edit2,'string','');
set(handles.edit3,'string','');
set(handles.edit4,'string','');
set(handles.edit5,'string','');
set(handles.radiobutton1,'value',0);
set(handles.radiobutton2,'value',0);
set(handles.edit5,"backgroundcolor",[0.94,0.94,0.94]);




function edit1_Callback(hObject, eventdata, handles)
% hObject    handle to edit1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 


% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles  empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), 

get(0,'defaultUicontrolBackgroundColor'))

    set(hObject,'BackgroundColor','white');
end



function edit2_Callback(hObject, eventdata, handles)
% hObject    handle to edit2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit2 as text
% str2double(get(hObject,'String')) returns contents of edit2 


% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles  empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), 

get(0,'defaultUicontrolBackgroundColor'))

    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in radiobutton2.
function radiobutton2_Callback(hObject, eventdata, handles) % 视频
% hObject    handle to radiobutton2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of radiobutton2
global vidObj;
filename = 'test.avi';
axes(handles.axes1);
vidObj = VideoReader(filename);
if hasFrame(vidObj)
    vidFrame = readFrame(vidObj);
end
axes(handles.axes1);    
imshow(vidFrame);
msgbox('获取图像序列成功!', '提示信息');

% --- Executes on button press in radiobutton1.
function radiobutton1_Callback(hObject, eventdata, handles) % 图片
% hObject    handle to radiobutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of radiobutton1
global im;
axes(handles.axes1);
[filename,pathname]=uigetfile({'*.bmp;*.jpg;*.png;*.jpeg;*.tif'},
'选择一个图片');
str=[pathname filename];
% 判断文件是否为空,也可以不用这个操作!直接读入图片也可以的
% im = imread(str);
% imshow(im)
if isequal(filename,0)||isequal(pathname,0)

    warndlg('please select a picture first!','warning');
    return;
else
    im=imread(str);
    imshow(im);
end



function edit3_Callback(hObject, eventdata, handles)
% hObject    handle to edit3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit3 as text
% str2double(get(hObject,'String')) returns contents of edit3 

% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handle empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), 

get(0,'defaultUicontrolBackgroundColor'))

    set(hObject,'BackgroundColor','white');
end



function edit4_Callback(hObject, eventdata, handles)
% hObject    handle to edit4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit4 as text
% str2double(get(hObject,'String')) returns contents of edit4


% --- Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),

 get(0,'defaultUicontrolBackgroundColor'))

    set(hObject,'BackgroundColor','white');
end



function edit5_Callback(hObject, eventdata, handles)
% hObject    handle to edit5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit5 as text
% str2double(get(hObject,'String')) returns contents of edit5 


% --- Executes during object creation, after setting all properties.
function edit5_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles  empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),

get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


 参考文献

【1】 吕普铁,李金,吴利予等.火灾视频图像的边缘自动检测研 究[J].应用科学.2003.

【2】孙凯军.基于视频图像的火灾监测系统与实现[D].南京理 工大学,2010

详情资料请扣扣:1341703358, MATLAB实验结果表明, 本文提出的火焰特征和烟雾特征提取算法具有优越性,时 效性更好,能够实现快速高效的监测。

猜你喜欢

转载自blog.csdn.net/Jiangtagong/article/details/124070496
今日推荐