Image Processing and Data Storage for Fire Alarm
, Saba Waseem1Journal of Engineering Research and Sciences, Volume 1, Issue 4, Page # 87-92, 2022; DOI: 10.55708/js0104012
Keywords: Fire Detection, Fire Safety, Image Processing, Data Storage
(This article belongs to the Special Issue on SP1 (Special Issue on Multidisciplinary Sciences and Advanced Technology 2022) and the Section Interdisciplinary Applications – Computer Science (IAC))
Export Citations
Cite
Rahman, M. Z. U. , Waseem, S. , Riaz, S. , Riaz, Z. , Asif, A. , Siddiqa, A. and Asghar, A. (2022). Image Processing and Data Storage for Fire Alarm. Journal of Engineering Research and Sciences, 1(4), 87–92. https://doi.org/10.55708/js0104012
Muhammad Zia ur Rahman, Saba Waseem, Sidra Riaz, Zainab Riaz, Aneeq Asif, Ayesha Siddiqa and Ali Asghar. "Image Processing and Data Storage for Fire Alarm." Journal of Engineering Research and Sciences 1, no. 4 (April 2022): 87–92. https://doi.org/10.55708/js0104012
M.Z.U. Rahman, S. Waseem, S. Riaz, Z. Riaz, A. Asif, A. Siddiqa and A. Asghar, "Image Processing and Data Storage for Fire Alarm," Journal of Engineering Research and Sciences, vol. 1, no. 4, pp. 87–92, Apr. 2022, doi: 10.55708/js0104012.
This paper explains the algorithm for fire alarm for the purpose of safety from any loss and property damage. Here, the designed algorithm is for the comparison of captured pictures. The purpose of comparison is to validate our results. In captured pictures, there may exist fire colour in pictures, which is the indication of fire in that specific area. Captured pictures are stored in folder and its path is stored in excel. We observed the indication of fired picture through fire alarm. When the fire is diminished, we used to reset button to stop the buzzer and to monitor the system again. The path of those pictures as well as the time and date of captured pictures will remain store in excel for later study of the failure of the system and also for the record purposes.
1. Introduction
Nowadays, conventional smoke detectors are widely used, however they take charge of a limited area. In large buildings, it may take time for the detection of smoke particles. Image-based smoke and fire detection is a latest technique, which can serve the requirement of fire detection in large buildings and outdoor environment.
Few researchers have done work on this latest technique. However, most of methods of fire detection are based on blurriness of image and geometry. Early studies about fire detection began with video based fire detection using colour indication. In [1], described algorithm of fire detection based on the temporal fluctuation of data of fire and used colour information. Another method, that was utilized in this paper, was the colour histogram to create a colour lookup table of flame pixels and thereafter took advantage of variation of pixels to predict whether it was a fire pixel or not. In [2], it is defined the process to detect the fire flame, however this algorithm used pixel information that cannot indicate fire pixels in appropriate way when there exist objects of same colour distribution as flame.
In [3], elaborated the technique of face recognition technique that employs the available databases of two different datasets in face recognition literature. Eigen faces and Fisher faces are applied to extract the relevant information from the images that are relevant for fire recognition in image processing. T.X. Truong [4] used the multi stage pattern recognition techniques to detect fire flame in video sequences. In the detailed description of visual analysis for the detection of fire flames in surveillance video, fire region is determined by colour ratio and motion of fire flame [5]. In [6], detailed explanation of the image processing technique to determine availability of free space for parking in a wireless device grid area, is provided.
In [7], it was not considered real time detection and combined tree-structured transform and occurrence of gray level matrices to predict the texture feature of flame and smoke. Yuan [8] provided the model of block motion and orientation to analyze real time smoke detection, and model can eliminate the disturbance created by artificial lights and moving objects. Research on smoke and flames were both show irregular motion of particles, create complex and turbulent phenomena that might be characterized by a dimensionless edge or surface measure [9].
In [10], it is employed the colour dynamic video sequences, which obtained from stationary camera to detect smoke and flame in sensitive areas. Fire safety journal [11] used the logistic regression and temporal smoothing for fire flame detection in inspection video.
The tool that is being used in this research work, is image processing. Using this, an algorithm is designed to detect the fire flame. When flame is detected through captured image, it is stored in Excel sheet, which will help the workers for further manipulation. A reset button is used, which help to reactivate the system after the fire flame detection but if problem is not terminated properly due to which the sparks occurs then it stops whenever it detects the spark and the image in which fire or spark is detected is stored in the computer for the use of the operator or master of the machine to detect the error with in no time and it remained the part of the history until operator delete it. In this the time whenever fire is detected the time is also noted and stored if any component detects repeatedly then operator has to inform its supervisor to replace that component [12–17].
In this algorithm, we are working on online Arduino to operate and reset the buzzer. According to our knowledge, this work is not done in all open literature. This algorithm may applicable in industries, to monitor fire sensitive devices and domestic purposes. Main advantage of our project is security of sensitive areas, where fire flame may occur and there is a danger for the lives of the worker as well [18]. In it you not need to check each element or component, you have to check only that region which is detected by the camera. So, it is also time saving as well as cost saving.
2. Methodology
In MATLAB, one cannot write code for arduino and use camera until libraries of arduino and USB camera are not added.
First of all, add the arduino library and USB camera library to MATLAB to use arduino and camera.
- Connect the Buzzer and the reset button to arduino as shown in the Figure 1.

- captures the images of that specific area where we want to detect the fire, instantly and repeatedly [19].
- The colour detection method is used to detect the fire image, we use the RGB ratio to detect the flame of the fire (if you have different flame just change the value of RGB and detect the fire) the ratio we use is as follows:
Flame = Red(100%) + Green(95.7%) – Blue(100%)
- When the fire in the image detected, it creates a folder “fired_data_pics” in PC at specified location as shown in the Figure 2.

- A subfolder of that date (when fire detected) is created in the “fired_data_pics” folder in which all the detected fired images are stored as shown in the Figure 3. The command used to create folder is as follows:
M-File:
t=fix(clock); d=int2str(t(:,3));
mo=int2str(t(:,2));
y=int2str(t(:,1));
day= [ d’_’mo’_’y]
g=’fire_data_pics’
l=sprintf(day)
file=fullfile(g,l)
mkdir (file)

- In this subfolder, the pictures are saved with their numbers arranged in an ascending order as shown in Figure 4.
M-File:
path=fullfile(‘F:\ProgramFiles\MATLAB\R2 015a\ fire_data_pics’,day);
name = ‘image_%04d.tif’;
i = i + 1;
image_name = sprintf(name,i);
fullnamed=fullfile(path,image_name); imwrite(fireimg, fullnamed);

- Similarly, an excel sheet is created for record as shown in the Figure 5. The command used to create excel file is as follows:
M-File:
header=’NO.’,’Fired image’,’Time’;
xlswrite(‘firealarm_data’,header,day,’B2′)

- Sheets of the different days are also generated in it as similar as the subfolders are created earlier as shown in the Figure 6.

- Time of fire indication is then noted and stored in created excel sheet as shown in Figure 7.

- The path of that image is stored in the excel sheet to help the user to find the fired image as shown in Figure 8.
M-File:
timec=fix(clock);
mins=int2str(timec(5));
hrs=int2str(timec(4));
if timec(5)<10
mins= [‘0}, mins];
end
time= [hrs ‘:’ mins];
inform={t,fullnamed,time};
t=t+1;
xlswrite(‘firealarm_data’, inform, day, k(i,:))
- As the fire detected, the buzzer will on as an indicator of fire alarm.
- Detected image then stored in created folder for the user to detect the origin of the fire and hence, the monitoring system is stopped.
- When the user clears the defects, then he has to press the reset button.
- When buzzer is alarmed after troubleshooting, a reset button is pressed to reactivate the system and the system starts monitoring and the buzzer is stopped.
- Our method is real time processing method and uses simple algorithm based on fire colour detection.
3. Proposed system architecture
The fire was detected at the start and a folder is created to store the image that was captured instantly by the system at the time of detection [20–23]. The date and time of fire detection, was stored in an excel file to see when the last event occurred. Buzzer was turned on from the start when the fire was detected and will remain in that state till the reset button was pressed and the system was reactivated [24].

4. Results
When the algorithm runs camera, it continuously monitor the specific area by capturing the images regularly [25] but it seemed like that a video of the specific area is formed.
Following Figure 9 is taken, when no fire is detected.

As the fire detected, the Figure 10 displays and the program stopped monitoring and the buzzer started as an indication of the fire alarm until the reset button is not pressed. The system starts working again after pressing the resetting button. Hence, it once again starts monitoring and the buzzer is ‘OFF’ if the fire is not terminate then it again stops and buzzer become ‘ON’. So, you have to completely repair the system before resetting the system.

Similarly, the same procedure can be used to detect the fire in some real scenarios such as in the room to any appliance such as computers, refrigerators, [26–30] circuit breakers and different electrical circuits. Burning of computer is shown in the Figure 11. Therefore, in this method, we can detect fire in its starting period and we can save ourselves from such extensive fire. In this way we will able to overcome the fire and save most of the part of the appliance.

Another example where we can use this type of fire detector is in the mines or tunnels. This can be very helpful in saving the lives of the laborers working in the mines. Whenever there exists some unfortunate event such as fire due to short circuits and no one examined it but camera caught that fire and alerts the workers to be attentive and active with the help of buzzer and showing the image of sparking area, so you the repair the damaged area and origin of the fire properly.

This type of method can also be use useful in industries or firms to detect the fire in the machinery.
Suppose [31], in a cloth factory the first step is to remove pilling from cloth this can be done through fire we can use this there as well, if the intensity of the fire increases from the set value then burner will stop [32] [33]. In this way we can save a lot of cloth and lives of the workers.
In the mill or factory there are many machines through which many functions are performed to run the factory or to build the products. There is a lot of chances that any machine or any component of the machine is overloaded and it burns then there is a chance that this spark may harm the machine and product as well [34–39].
If we use this method then sparks of the components are being noticed and form data and picture collection necessary steps are easy to be taken with in the right time. In the Figure 13 the same agenda is shown as I described.

5. Conclusions
Keeping in view the importance of time nowadays, this method could be considered the most helpful and affordable technique for fire detection as it takes less time [40–42] to detect the fire and takes images instantly. Additionally, it is the most convenient and useful method in the sense that it stores the detected image for the user to troubleshoot the defected area in no time and replace or manage the load for the specific part or component of the machine. Information like the path of detected image and time at which fire was detected is stored in an excel file which is helpful to check the history of the machine for workers and managers.
This system is economical, simple, and easy to introduce in industry and a public area with the end goal of safety [43–46]. It is obvious that our results are better than previously introduced techniques. Every system in the world has some pros and cons [47]. The limitation associated with this working phenomenon includes that it cannot be utilized in an open-air environment, as it uses a color detection method to detect fire. Consequently, it is relevant just for some particular monitoring such as monitoring process of the machinery, fire monitoring in the mines, and for the monitoring of appliances [48] [49]. We can additionally work on this system by attaching a fire extinguisher with it so that it can diminish the fire whenever fire is detected [50]. This is exceptionally useful in making the lives of individuals safe. Hence, the designed algorithm is unique and very simple for controlling.
- H. Yamagishi, J. Yamaguchi, “A contour fluctuation data processing method for fire flame detection using a color camera,” 2000 26th Annual Conference of the IEEE Industrial Electronics Society. IECON 2000. 2000 IEEE International Conference on Industrial Electronics, Control and Instrumentation. 21st Century Technologies , vol. 2, pp. 824–829 , 2000, doi: https://doi.org/10.1109/IECON.2000.97222.
- S.-J. Wang et al., “Video-based early flame detection for vessels by using the fuzzy color clustering algorithm,” Proc. Int. Computer Symp, vol. 3, pp. 1179–1184, 2006.
- W. Zhao et al., “Face recognition: A literature survey,” ACM computing surveys (CSUR), vol. 35, no. 4, pp. 399–458, 2003.
- T. X. Truong, J.-M. Kim, “Fire flame detection in video sequences using multi-stage pattern recognition techniques,” Engineering Applications of Artificial Intelligence, vol. 25, no. 7, pp. 1365–1372, 2012, doi: https://doi.org/10.1016/j.engappai.2012.05.007.
- M. Li et al., “Review of fire detection technologies based on video image,” Journal of theoretical and applied information technology, vol. 49, no. 2, pp. 700–707, 2013.
- D. B. L. Bong, K. C. Ting, K. C. Lai, “Integrated Approach in the Design of Car Park Occupancy Information System (COINS).,” IAENG International Journal of Computer Science, vol. 35, no. 1, 2008.
- Y. Cui, H. Dong, E. Zhou, “An early fire detection method based on smoke texture analysis and discrimination,” 2008 Congress on Image and Signal Processing, vol. 3, pp. 95–99, 2008, doi: 10.1109/CISP.2008.397.
- F. Yuan, “A fast accumulative motion orientation model based on integral image for video smoke detection,” Pattern Recognition Letters, vol. 29, no. 7, pp. 925–932, 2008.
- Z. Xiong et al., “Video-based smoke detection: possibilities, techniques, and challenges,” IFPA, fire suppression and detection research and applications—a technical working conference (SUPDET), Orlando, FL, 2007.
- Y. H. Habiboğlu, O. Günay, A. E. Cetin, “Flame detection method in video using covariance descriptors,” 2011 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 1817–1820, 2011, doi: 10.1109/ICASSP.2011.5946857.
- S. G. Kong et al., “Fast fire flame detection in surveillance video using logistic regression and temporal smoothing,” Fire Safety Journal, vol. 79, pp. 37–43, 2016, doi: 10.1016/j.firesaf.2015.11.015.
- J. Sang et al., “Joint image compression and encryption using IWT with SPIHT, Kd-tree and chaotic maps,” Applied Sciences, vol. 8, no. 10, pp. 1963, 2018, doi: 10.3390/app8101963.
- A. Mateen, M. Azeem, M. Shafiq, “AZ model for software development,” arXiv preprint arXiv:1612.08811, 2016.
- M. A. Akbar et al., “Investigation of Project Administration related challenging factors of Requirements Change Management in global software development: A systematic literature review,” 2018 International Conference on Computing, Electronic and Electrical Engineering (ICE Cube), pp. 1–7, 2018, doi: 10.1109/ICECUBE.2018.8610966.
- M. A. Akbar et al., “Improving the quality of software development process by introducing a new methodology–AZ-model,” IEEE Access, vol. 6, pp. 4811–4823, 2017.
- M. A. Akbar et al., “A fuzzy analytical hierarchy process to prioritize the success factors of requirement change management in global software development,” Journal of Software: Evolution and Process, vol. 33, no. 2, pp. e2292, 2021.
- M. A. Akbar et al., “A robust framework for cloud‐based software development outsourcing factors using analytical hierarchy process,” Journal of Software: Evolution and Process, vol. 33, no. 2, pp. e2275, 2021, doi: 10.1002/smr.2275.
- M.Z. Rahman et al., “The Prescribed Fixed Structure Intelligent Robust Control of an Electrohydraulic Servo System”, Mathematical Problems in Engineering, vol. 2022, 12, 2022. Doi: 10.1155/2022/5144602
- U. Farooq et al., “A Reliable Approach to Protect and Control of Wind Solar Hybrid DC Microgrids,” 2019 IEEE 3rd Conference on Energy Internet and Energy System Integration (EI2), Changsha, China, 348-353, 2019. doi: 10.1109/EI247390.2019.9062101.
- M. Taiyaba et al., “Secure V2X Environment using Blockchain Technology.” In Proceedings of the Evaluation and Assessment in Software Engineering, pp. 469-474. 2020. DOI: 10.1145/3383219.3383287
- M. Shafiq et al., “Towards successful global software development.” In Proceedings of the Evaluation and Assessment in Software Engineering, 445-450. 2020. DOI: 10.1145/3383219.3383283
- S. Akram, M. Shafiq, M. A. Akbar, “Automated risk analysis model for software development enhancement,” International Journal of Multidisciplinary Sciences and Engineering, vol. 7, no. 8, pp. 23–27, 2016.
- N. Nasrullah et al., “Reversible data hiding in compressed and encrypted images by using Kd-tree,” Multimedia Tools and Applications, vol. 78, no. 13, pp. 17535–17554, 2019.
- J. Ahmad et al., “The deep neural network based classification of fingers pattern using electromyography,” 2018 2nd IEEE Advanced Information Management, Communicates, Electronic and Automation Control Conference (IMCEC), pp. 455–461, 2018, doi: 10.1109/IMCEC.2018.8469534
- M. A. Akbar et al., “AZ-Model of software requirements change management in global software development,” 2018 International Conference on Computing, Electronic and Electrical Engineering (ICE Cube), pp. 1–6, 2018.
- M. A. Akbar et al., “Organization type and size based identification of requirements change management challenges in global software development,” IEEE Access, vol. 8, pp. 94089–94111, 2020.
- A. A. Khan, M. A. Akbar, “Systematic literature review and empirical investigation of motivators for requirements change management process in global software development,” Journal of Software: Evolution and Process, vol. 32, no. 4, pp. e2242, 2020.
- M. A. Akbar et al., “Prioritizing Management Success Factors in Offshore Software Development,” Arabian Journal for Science and Engineering, vol. 45, no. 12, pp. 10163–10184, 2020.
- T. Kamal, Q. Zhang, M. A. Akbar, “Toward successful agile requirements change management process in global software development: a client–vendor analysis,” IET Software, vol. 14, no. 3, pp. 265–274, 2020.
- M. A. Akbar et al., “An empirical study investigation of task allocation process barriers in the context of offshore software development outsourcing: An organization size based analysis,” International Journal of Computing and Digital Systems, vol. 8, no. 04, pp. 343–350, 2019, doi: 10.12785/ijcds/080403.
- M. A. Akbar et al., “Prioritization of global software requirements’ engineering barriers: An analytical hierarchy process,” IET Software, vol. 15, no. 4, pp. 277–291, 2021, doi: 10.1049/sfw2.12022.
- M. A. Akbar et al., “Success factors influencing requirements change management process in global software development,” Journal of Computer Languages, vol. 51, pp. 112–130, 2019, doi: 10.1016/j.cola.2018.12.005.
- M. A. Akbar et al., “Investigation of the requirements change management challenges in the domain of global software development,” Journal of Software: Evolution and Process, vol. 31, no. 10, pp. e2207, 2019, doi: 10.1002/smr.2207.
- M. T. Riaz et al., “Wireless android based home automation system,” Adv. Sci. Technol. Eng. Syst. J, vol. 2, no. 1, pp. 234–239, 2017, doi: 10.25046/aj020128.
- M. T. Riaz et al., “A wireless controlled intelligent healthcare system for diplegia patients,” Mathematical Biosciences and Engineering, vol. 19, no. 1, pp. 456–472, 2022, doi: https://doi.org/10.3934/mbe.2022022.
- H. A. Javaid et al., “Classification of Hand Movements Using MYO Armband on an Embedded Platform,” Electronics, vol. 10, no. 11, pp. 1322, 2021, doi: 10.3390/electronics10111322.
- M. T. Riaz et al., “The Intelligent Transportation Systems with Advanced Technology of Sensor and Network,” 2021 International Conference on Computing, Electronic and Electrical Engineering (ICE Cube), pp. 1–6, 2021.
- M. T. Riaz et al., “Design and Experimental Validation of a Small-Scale Prototype Active Aerostatic Thrust Bearing,” 2021 International Conference on Computing, Electronic and Electrical Engineering (ICE Cube), pp. 1–6, 2021.
- M. T. Riaz et al., “Wireless model for high voltage Direct Current measurement using Hall sensor,” 2021 International Bhurban Conference on Applied Sciences and Technologies (IBCAST), pp. 642–647, 2021. doi: 10.1109/IBCAST51254.2021.9393186.
- M. T. Riaz et al., “Analysis and Evaluating the Effect of Harmonic Distortion Levels in Industry,” 2021 4th International Conference on Energy Conservation and Efficiency (ICECE), pp. 1–7, 2021, doi:10.1109/ICECE51984.2021.9406283.
- M. T. Riaz et al., “Steady state analysis of HVDC transmission system based on MATLAB/SIMULINK,” 2019 International Conference on Electrical, Communication, and Computer Engineering (ICECCE), pp. 1–6, 2019, doi: 10.1109/ICECCE47252.2019.8940745.
- M. T. Riaz et al., “Research on the Protection of Hybrid HVDC System,” 2018 International Conference on Power Generation Systems and Renewable Energy Technologies (PGSRET), pp. 1–6, 2018, doi:10.1109/PGSRET.2018.8686007.
- M. T. Riaz et al., “Investigation of Electrical Properties of Epoxy Resin Composite with the Surface Modification of SiO 2 Nanoparticles,” 2021 International Conference on Computing, Electronic and Electrical Engineering (ICE Cube), pp. 1–5, 2021, doi: 10.1109/ICECube53880.2021.9628354.
- M. T. Riaz et al., “Design of a Free Energy Generator using Gravity Wheel & Dynamo,” 2021 4th International Conference on Energy Conservation and Efficiency (ICECE), pp. 1–5, 2021.
- M. Idrees et al., “Fuzzy logic based calculation and analysis of health index for power transformer installed in grid stations,” 2019 international symposium on recent advances in electrical engineering (RAEE), vol. 4, pp. 1–6, 2019.
- M. A. Akbar et al., “Requirement change management challenges in GSD: An analytical hierarchy process approach,” Journal of Software: Evolution and Process, vol. 32, no. 7, pp. e2246, 2020.
- M. A. Akbar et al., “Multicriteria decision making taxonomy of cloud-based global software development motivators,” IEEE Access, vol. 8, pp. 185290–185310, 2020, doi: 10.1109/ACCESS.2020.3030124.
- H. A. Raza et al., “Analysis the effect of 500kv High-Voltage Power Transmission Line on the Output Efficiency of Solar-Panels,” 2019 International Conference on Electrical, Communication, and Computer Engineering (ICECCE), pp. 1–6, 2019, doi:10.1109/ICECCE47252.2019.8940803.
- L. Hanwu et al., “Regularity of Current Dispersal in Different Kinds of Grounding Electrode,” 2018 IEEE International Conference on High Voltage Engineering and Application (ICHVE), pp. 1–4, 2018, doi:10.1109/ICHVE.2018.8642240.
- M. A. Akbar et al., “Towards successful agile development process in software outsourcing environment: a systematic literature review,” International Journal of Business Innovation and Research, vol. 23, no. 2, pp. 141–167, 2020.
- Muhammad Zia ur Rahman, Saba Waseem, Sidra Riaz, Zainab Riaz, Aneeq Asif, Ayesha Siddiqa, Ali Asghar, “Disinfecting Omnidirectional Mobile Robot with Vision Capabilities”, Journal of Engineering Research and Sciences, vol. 1, no. 3, pp. 153, 2022. doi: 10.55708/js0103016