{"id":60,"date":"2015-04-27T09:12:00","date_gmt":"2015-04-27T09:12:00","guid":{"rendered":"http:\/\/www.mertkahyaoglu.com\/?p=60"},"modified":"2021-05-14T09:18:37","modified_gmt":"2021-05-14T09:18:37","slug":"60","status":"publish","type":"post","link":"https:\/\/www.mertkahyaoglu.com\/index.php\/2015\/04\/27\/60\/","title":{"rendered":"Automatic Fire Detection with Matlab"},"content":{"rendered":"\n<p>Hello all,<\/p>\n\n\n\n<p>I am want to share my term project that lessons name is Digital Signal Processing Design &amp; Applications. I spend a lot of my time to this project unfortunately I couldn\u2019t find what I did want to do. So I thought a little and came up with basic algorithm to do solve this project. Sorry I forget to&nbsp;explain my project to you.<\/p>\n\n\n\n<p>So&nbsp;The important things is recognize to fire on early stage ! I&nbsp;want to detect fire automatically when it\u2019s on early stages.&nbsp;Also to make fire extinction easier for controlling the fire and smoke.<\/p>\n\n\n\n<p>Imagine that if you see fire and you run to where is the fire break glass. This is one of the solutions.&nbsp;Another solution is a smoke and heat sensor system. Yes, this is a good solution but this is not recognized as the early stage of fire!<\/p>\n\n\n\n<p>So, what I am thinking about this problem ? . I want to say I&nbsp;didn\u2019t search any Project for this course. I wanted to this Project. And also I have already develop this Project.<\/p>\n\n\n\n<p>My solution is image processing because images see that wide area. And computer determinate to fire detected or no fire in here. This also solves the basic solution. In the future it makes saves lives.<\/p>\n\n\n\n<p><strong>Algorithm<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Determine<\/strong><strong>&nbsp;of&nbsp;<\/strong><strong>digital<\/strong>&nbsp;<strong>image<\/strong><\/li><li><strong>Convert<\/strong>&nbsp;<strong>to<\/strong><strong>&nbsp;R G B&nbsp;<\/strong><strong>Colour<\/strong>&nbsp;<strong>range<\/strong>&nbsp;<strong>Matrix<\/strong><\/li><li><strong>Selection<\/strong><strong>&nbsp;of&nbsp;<\/strong><strong>yellow<\/strong>&nbsp;<strong>colour<\/strong>&nbsp;<strong>range<\/strong><strong>&nbsp;on&nbsp;<\/strong><strong>photo<\/strong><\/li><li><strong>Convert<\/strong>&nbsp;<strong>image<\/strong>&nbsp;<strong>to<\/strong>&nbsp;<strong>binary<\/strong>&nbsp;<strong>range<\/strong><\/li><li><strong>Count<\/strong>&nbsp;<strong>that<\/strong><strong>&nbsp;how&nbsp;<\/strong><strong>much<\/strong>&nbsp;<strong>binary<\/strong><strong>&nbsp;inside&nbsp;<\/strong><strong>the<\/strong>&nbsp;<strong>image<\/strong><\/li><\/ul>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/www.mertkahyaoglu.com\/wp-content\/uploads\/2021\/05\/Project-Report-Automatic-Fire-Detection.pdf\">Project-Report-Automatic-Fire-Detection<\/a><a href=\"https:\/\/www.mertkahyaoglu.com\/wp-content\/uploads\/2021\/05\/Project-Report-Automatic-Fire-Detection.pdf\" class=\"wp-block-file__button\" download>Download<\/a><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>foto = imread('fire.jpg');\r\nfoto2 = imread('fire2.jpg');\r\nfoto3 = imread('fire3.jpg');\r\nfoto4 = imread('fire4.jpg');\r\nfoto5 = imread('fire5.jpg');\r\nfoto6 = imread('fire6.jpg');\r\nfoto7 = imread('fire7.jpg');\r\nfoto8 = imread('fire8.jpg');\r\nfoto9 = imread('fire9.jpg');\r\nfoto10 = imread('fire10.jpg');\r\nfoto11 = imread('fire11.jpg');\r\nfoto12 = imread('fire12.jpg');\r\nfoto13 = imread('fire13.jpg');\r\n \r\nfigure(1)\r\n \r\n%--------------------------------\r\nsubplot(4,6,1)\r\nimshow(foto)\r\n \r\ntitle(num2str(1))\r\n \r\nR = foto(:, :, 1);\r\nG = foto(:, :, 2);\r\nB = foto(:, :, 3);\r\n \r\nyellowness = (single(R) + single(G))\/2 - single(B);\r\nbinaryYellow = yellowness > 120; \r\n \r\nsubplot(4,6,2)\r\nimshow(binaryYellow)\r\n \r\n \r\n tesbit1=sum(binaryYellow(:));\r\n \r\n if tesbit1>1500 \r\nh = waitbar(0, 'Fire Detected');\r\nset(h,'Name', 'Picture 1')\r\ntitle('Fire Detected')\r\nelse\r\nh = waitbar(0, 'No fire');\r\nset(h,'Name', 'Picture 1')\r\ntitle('No Fire')\r\nend\r\n \r\n %----------------------------------------------------------------------------\r\n \r\nsubplot(4,6,3)\r\nimshow(foto2)\r\n \r\ntitle(num2str(2))\r\n \r\nR = foto2(:, :, 1);\r\nG = foto2(:, :, 2);\r\nB = foto2(:, :, 3);\r\n \r\nyellowness = (single(R) + single(G))\/2 - single(B);\r\nbinaryYellow = yellowness > 120; \r\n \r\nsubplot(4,6,4)\r\nimshow(binaryYellow)\r\n \r\n tesbit2=sum(binaryYellow(:));\r\n \r\n if tesbit2>1500 \r\nh = waitbar(0, 'Fire Detected');\r\nset(h,'Name', 'Picture 2')\r\ntitle('Fire Detected')\r\nelse\r\nh = waitbar(0, 'No fire');\r\nset(h,'Name', 'Picture 2') \r\ntitle('No Fire')\r\nend\r\n \r\n%--------------------------------\r\n subplot(4,6,5)\r\nimshow(foto3)\r\n \r\ntitle(num2str(3))\r\n \r\nR = foto3(:, :, 1);\r\nG = foto3(:, :, 2);\r\nB = foto3(:, :, 3);\r\n \r\nyellowness = (single(R) + single(G))\/2 - single(B);\r\nbinaryYellow = yellowness > 120; \r\n \r\nsubplot(4,6,6)\r\nimshow(binaryYellow)\r\n \r\n tesbit3=sum(binaryYellow(:));\r\n \r\n if tesbit3>1500 \r\nh = waitbar(0, 'Fire Detected');\r\nset(h,'Name', 'Picture 3')\r\ntitle('Fire Detected')\r\nelse\r\nh = waitbar(0, 'No fire');\r\nset(h,'Name', 'Picture 3')\r\ntitle('No Fire')\r\nend\r\n%--------------------------------\r\nsubplot(4,6,7)\r\nimshow(foto4)\r\n \r\ntitle(num2str(4))\r\n \r\nR = foto4(:, :, 1);\r\nG = foto4(:, :, 2);\r\nB = foto4(:, :, 3);\r\n \r\nyellowness = (single(R) + single(G))\/2 - single(B);\r\nbinaryYellow = yellowness > 120; \r\n \r\nsubplot(4,6,8)\r\nimshow(binaryYellow)\r\n \r\n tesbit4=sum(binaryYellow(:));\r\n \r\nif tesbit4>1500 \r\nh = waitbar(0, 'Fire Detected');\r\nset(h,'Name', 'Picture 4')\r\ntitle('Fire Detected')\r\nelse\r\nh = waitbar(0, 'No fire');\r\nset(h,'Name', 'Picture 4')\r\ntitle('No Fire')\r\nend\r\n%--------------------------------\r\nsubplot(4,6,9)\r\nimshow(foto5)\r\n \r\ntitle(num2str(5))\r\n \r\nR = foto5(:, :, 1);\r\nG = foto5(:, :, 2);\r\nB = foto5(:, :, 3);\r\n \r\nyellowness = (single(R) + single(G))\/2 - single(B);\r\nbinaryYellow = yellowness > 120; \r\n \r\nsubplot(4,6,10)\r\nimshow(binaryYellow)\r\n \r\n tesbit5=sum(binaryYellow(:));\r\n \r\n if tesbit5>1500 \r\nh = waitbar(0, 'Fire Detected');\r\nset(h,'Name', 'Picture 5')\r\ntitle('Fire Detected')\r\nelse\r\nh = waitbar(0, 'No fire');\r\nset(h,'Name', 'Picture 5')\r\ntitle('No Fire')\r\nend\r\n \r\n%--------------------------------\r\nsubplot(4,6,11)\r\nimshow(foto6)\r\n \r\ntitle(num2str(6))\r\n \r\nR = foto6(:, :, 1);\r\nG = foto6(:, :, 2);\r\nB = foto6(:, :, 3);\r\n \r\nyellowness = (single(R) + single(G))\/2 - single(B);\r\nbinaryYellow = yellowness > 120; \r\n \r\nsubplot(4,6,12)\r\nimshow(binaryYellow)\r\n \r\n tesbit6=sum(binaryYellow(:));\r\n \r\n if tesbit6>1500 \r\nh = waitbar(0, 'Fire Detected');\r\nset(h,'Name', 'Picture 6')\r\ntitle('Fire Detected')\r\nelse\r\nh = waitbar(0, 'No fire');\r\nset(h,'Name', 'Picture 6')\r\ntitle('No Fire')\r\nend\r\n%--------------------------------\r\nsubplot(4,6,13)\r\nimshow(foto7)\r\n \r\ntitle(num2str(7))\r\n \r\nR = foto7(:, :, 1);\r\nG = foto7(:, :, 2);\r\nB = foto7(:, :, 3);\r\n \r\nyellowness = (single(R) + single(G))\/2 - single(B);\r\nbinaryYellow = yellowness > 120; \r\n \r\nsubplot(4,6,14)\r\nimshow(binaryYellow)\r\n \r\n tesbit7=sum(binaryYellow(:));\r\n \r\n if tesbit7>1500 \r\nh = waitbar(0, 'Fire Detected');\r\nset(h,'Name', 'Picture 7')\r\ntitle('Fire Detected')\r\nelse\r\nh = waitbar(0, 'No fire');\r\nset(h,'Name', 'Picture 7')\r\ntitle('No Fire')\r\nend\r\n%--------------------------------\r\nsubplot(4,6,15)\r\nimshow(foto8)\r\n \r\ntitle(num2str(8))\r\n \r\nR = foto8(:, :, 1);\r\nG = foto8(:, :, 2);\r\nB = foto8(:, :, 3);\r\n \r\nyellowness = (single(R) + single(G))\/2 - single(B);\r\nbinaryYellow = yellowness > 120; \r\n \r\nsubplot(4,6,16)\r\nimshow(binaryYellow)\r\n \r\n tesbit8=sum(binaryYellow(:));\r\n \r\n if tesbit8>1500 \r\nh = waitbar(0, 'Fire Detected');\r\nset(h,'Name', 'Picture 8')\r\ntitle('Fire Detected')\r\nelse\r\nh = waitbar(0, 'No fire');\r\nset(h,'Name', 'Picture 8')\r\ntitle('No Fire')\r\nend\r\n%--------------------------------\r\nsubplot(4,6,17)\r\nimshow(foto9)\r\n \r\ntitle(num2str(9))\r\n \r\nR = foto9(:, :, 1);\r\nG = foto9(:, :, 2);\r\nB = foto9(:, :, 3);\r\n \r\nyellowness = (single(R) + single(G))\/2 - single(B);\r\nbinaryYellow = yellowness > 120; \r\n \r\nsubplot(4,6,18)\r\nimshow(binaryYellow)\r\n \r\n tesbit9=sum(binaryYellow(:));\r\n \r\n if tesbit9>1500 \r\nh = waitbar(0, 'Fire Detected');\r\nset(h,'Name', 'Picture 9')\r\ntitle('Fire Detected')\r\nelse\r\nh = waitbar(0, 'No fire');\r\nset(h,'Name', 'Picture 9')\r\ntitle('No Fire')\r\nend\r\n%--------------------------------\r\nsubplot(4,6,19)\r\nimshow(foto10)\r\n \r\ntitle(num2str(10))\r\n \r\nR = foto10(:, :, 1);\r\nG = foto10(:, :, 2);\r\nB = foto10(:, :, 3);\r\n \r\nyellowness = (single(R) + single(G))\/2 - single(B);\r\nbinaryYellow = yellowness > 120; \r\n \r\nsubplot(4,6,20)\r\nimshow(binaryYellow)\r\n \r\n tesbit10=sum(binaryYellow(:));\r\n \r\n if tesbit10>1500 \r\nh = waitbar(0, 'Fire Detected');\r\nset(h,'Name', 'Picture 10')\r\ntitle('Fire Detected')\r\nelse\r\nh = waitbar(0, 'No fire');\r\nset(h,'Name', 'Picture 10')\r\ntitle('No Fire')\r\nend\r\n%--------------------------------\r\nsubplot(4,6,21)\r\nimshow(foto11)\r\n \r\ntitle(num2str(11))\r\n \r\nR = foto11(:, :, 1);\r\nG = foto11(:, :, 2);\r\nB = foto11(:, :, 3);\r\n \r\nyellowness = (single(R) + single(G))\/2 - single(B);\r\nbinaryYellow = yellowness > 120; \r\n \r\nsubplot(4,6,22)\r\nimshow(binaryYellow)\r\n \r\n tesbit11=sum(binaryYellow(:));\r\n \r\n if tesbit11>1500 \r\nh = waitbar(0, 'Fire Detected');\r\nset(h,'Name', 'Picture 11')\r\ntitle('Fire Detected')\r\nelse\r\nh = waitbar(0, 'No fire');\r\nset(h,'Name', 'Picture 11')\r\ntitle('No Fire')\r\nend\r\n%--------------------------------\r\nsubplot(4,6,23)\r\nimshow(foto12)\r\n \r\ntitle(num2str(12))\r\n \r\nR = foto12(:, :, 1);\r\nG = foto12(:, :, 2);\r\nB = foto12(:, :, 3);\r\n \r\nyellowness = (single(R) + single(G))\/2 - single(B);\r\nbinaryYellow = yellowness > 120; \r\n \r\nsubplot(4,6,24)\r\nimshow(binaryYellow)\r\n \r\n tesbit12=sum(binaryYellow(:));\r\n \r\n if tesbit12>1500 \r\nh = waitbar(0, 'Fire Detected');\r\nset(h,'Name', 'Picture 12')\r\ntitle('Fire Detected')\r\nelse\r\nh = waitbar(0, 'No fire');\r\nset(h,'Name', 'Picture 12')\r\ntitle('No Fire')\r\nend\r\n%--------------------------------\r\n \r\n%--------------------------------\r\n \r\n\r\n\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Hello all, I am want to share my term project that lessons name is Digital Signal Processing Design &amp; Applications. I spend a lot of my time to this project unfortunately I couldn\u2019t find what I did want to do. So I thought a little and came up with basic algorithm to do solve this project. Sorry I forget to&nbsp;explain my project to you. So&nbsp;The important things is recognize to fire on early stage ! I&nbsp;want to detect fire automatically when it\u2019s on early stages.&nbsp;Also to make fire extinction easier for controlling the fire and smoke. Imagine that if you see fire and you run to where is the fire break glass. This is one of the solutions.&nbsp;Another solution is a smoke and heat sensor system. Yes, this is a good solution but this is not recognized as the early stage of fire! So, what I am thinking about this problem ? . I want to say I&nbsp;didn\u2019t search any Project for this course. I wanted to this Project. And also I have already develop this Project. My solution is image processing because images see that wide area. And computer determinate to fire detected or no fire in here. This&#8230;<\/p>\n","protected":false},"author":1,"featured_media":61,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-60","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-electronic","wpcat-7-id"],"_links":{"self":[{"href":"https:\/\/www.mertkahyaoglu.com\/index.php\/wp-json\/wp\/v2\/posts\/60","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mertkahyaoglu.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mertkahyaoglu.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mertkahyaoglu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mertkahyaoglu.com\/index.php\/wp-json\/wp\/v2\/comments?post=60"}],"version-history":[{"count":3,"href":"https:\/\/www.mertkahyaoglu.com\/index.php\/wp-json\/wp\/v2\/posts\/60\/revisions"}],"predecessor-version":[{"id":65,"href":"https:\/\/www.mertkahyaoglu.com\/index.php\/wp-json\/wp\/v2\/posts\/60\/revisions\/65"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mertkahyaoglu.com\/index.php\/wp-json\/wp\/v2\/media\/61"}],"wp:attachment":[{"href":"https:\/\/www.mertkahyaoglu.com\/index.php\/wp-json\/wp\/v2\/media?parent=60"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mertkahyaoglu.com\/index.php\/wp-json\/wp\/v2\/categories?post=60"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mertkahyaoglu.com\/index.php\/wp-json\/wp\/v2\/tags?post=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}