Sir,Can you please Tell me some idea to Implement Fire Detection in Live Camera Streaming

1 view (last 30 days)
Dear All Can you please Tell me some idea to Implement Fire Detection in Live Camera Streaming... Iam learning the Basics of mATLAB.pleasse specify some Easy Algorithm to do the code

Accepted Answer

Image Analyst
Image Analyst on 9 Aug 2014
There probably is no easy way unless you have a very constrained specific problem, like you're closely zoomed in on a pilot light or something. For algorithms that may be somewhat more general, look here: http://www.visionbib.com/bibliography/motion-f747fir1.html#Surveillance%20Systems,%20Applied%20to%20Fire%20and%20Flame%20Detection. Pick an algorithm, code it up, and come back if you have questions on your code.
If you have a very simple case like a background of one color and flames/fire of a different color you might be able to use my Image Segmentation Tutorial or one of the color segmentation demos. It's hard to make suggestions when you do not post any typical images that you're going to deal with. Usually people post images when they want image processing advice.
  3 Comments
Arul Suju
Arul Suju on 9 Aug 2014
Edited: Arul Suju on 9 Aug 2014
i=imread('fire.jpg');
C = makecform('srgb2Lab');
i_Lab = applycform(i,C);
x=i_Lab(:,:,1);
y=i_Lab(:,:,2);
z=i_Lab(:,:,3);
L=sum(x);
L=sum(L');
a=sum(y);
a=sum(a');
b=sum(z);
b=sum(b');
d=zeros(150,200);
L=L/(150*200);
a=a/(150*200);
b=b/(150*200);
for p=1:1:150
for q=1:1:200
if (x(p,q)>L)
d(p,q)=1;
else d(p,q)=0;
end;
end;
end;
e=zeros(150,200);
for p=1:1:150
for q=1:1:200
if (y(p,q)>a)
e(p,q)=1;
else e(p,q)=0;
end;
end;
end;
f=zeros(150,200);
for p=1:1:150
for q=1:1:200
if (z(p,q)>b)
f(p,q)=1;
else f(p,q)=0;
end;
end;
end;
g=zeros(150,200);
for p=1:1:150
for q=1:1:200
if (y(p,q)>z(p,q))
g(p,q)=1;
else g(p,q)=0;
end;
end;
end;
h=zeros(150,200);
for p=1:1:150
for q=1:1:200
if (d(p,q)&&e(p,q)&&f(p,q)&&g(p,q)==1)
h(p,q)=1;
else h(p,q)=0;
end;
end;
end;
h=sum(h);
h=sum(h');
if (h >10 )
fprintf('FIRE DETECTED\n');
else
fprintf('FIRE NOT DETECTED\n');
end;
I am getting fire not detected .. whats wrongs with this code
Image Analyst
Image Analyst on 9 Aug 2014
Use the debugger. Or please make it easier by adding comments to this so we can tell what it's doing easier. The last lines
h=sum(h);
h=sum(h');
can be combined
h = sum(h(:));

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!