資源簡介
根據火焰區域亮度比周圍高的特點檢測并框選出火焰區域
代碼片段和文件信息
clc;
clear;
close?all;
%?Test_img=imread(‘.\TestPic\1.jpg‘);??%%?讀入圖像?
Test_img=imread(‘.\Picture\4.jpg‘);
%Test_img=imresize(Test_img[168256]);%改變尺寸
tic;
[Test_widthTest_highthTest_path]=size(Test_img);
img_gray=rgb2gray(Test_img);??????
[level?EM]=graythresh(img_gray);
if?level<0.5
????level=2*level;
else
????level=EM;
end
img_bw=im2bw(img_graylevel);%二值化
toc;
%-------------
評論
共有 條評論