matlab codes for smoke detection in video
#1

disuniting of structures and design principles. joint deformation
Reply
#2

This code should detect smoke in the video and the alarm will be active, but the active warning for all videos, even the videos will not smoke.

vid=uigetfile;
vid=mmreader(vid);
numFrames = vid.NumberOfFrames;
n=numFrames;
for i =1:n
frames = read(vid,i);
imwrite(frames,[int2str(i) '.jpg']);
end
frm1=rgb2gray(imread('1.jpg'));
for j=1:n      
   frm2=([num2str(j),'.jpg']);
   p1=(imread(frm2,'jpg'));
   p2=(rgb2gray(p1));
   res=abs(double(p2)-double(frm1));
   astn=get(handles.edt,'string');
   astn=str2num(astn);
   ast=res>astn;
   bw=bwareaopen(ast,500);
   R=p1(:,:,1);
   G=p1(:,:,2);
   B=p1(:,:,3);
   xr=R(bw);
   r=mean(xr);
   xg=G(bw);
   g=mean(xg);
   xb=B(bw);
   b=mean(xb);
   avg=(r+g+b)/3;
   S=(abs(r-avg)+abs(b-avg)+abs(g-avg))/3;
   if (S<astn)
       set(handles.text1,'visible','on');
        beep
        subplot(211)
        h1 = image;
        axis ij
        imshow(p1,h1);
       pause(0.5);
       set(handles.text1,'visible','off');
       pause(0.5);


     end;
 end



Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: music video codes, smoke detection matlab example code, codes video, smoke detection using matlab simulation, matlab codes for drowsiness detection system, matlab simulation circuit for smoke sensor, matlab codes in video segmentation,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  circuit diagram of smoke detector using at89s52 2 13,806 29-06-2018, 01:05 PM
Last Post: Guest
  how to calculate distance in heed protocol by using matlab 1 1,887 15-06-2018, 03:54 PM
Last Post: Guest
  matlab code for incremental conductance mppt 1 1,426 02-05-2018, 02:28 PM
Last Post: eksi
  anomaly detection code in matlab 3 2,094 23-04-2018, 12:04 AM
Last Post: Guest
  matlab code for liver tumor segmentation 2 1,585 01-04-2018, 06:29 PM
Last Post: [email protected]
  matlab code for vehicle tracking using unscented kalman filter 3 16,886 26-03-2018, 08:57 PM
Last Post: fodayj
  matlab code for facial expression recognition using frequency domain 1 2,683 19-02-2018, 06:03 PM
Last Post: Guest
  matlab code shadow detection and removal in colour images using matlab 2 2,262 12-01-2018, 01:24 PM
Last Post: dhanabhagya
  ppt for bomb detection using robot 3 2,651 02-01-2018, 03:40 PM
Last Post: dhanabhagya
  simulink matlab model upqc mdl 3 6,777 18-12-2017, 09:08 AM
Last Post: jaseela123d

Forum Jump: