This repo contains code that will detect fire in the room using live feed from a camera. The portion of the image with fire will be highlighted in red. We have used HAAR cascade classifier to classify the images as positives and negatives. Classifier has been trained using OpenCV on command line on a Windows 10 machine.
- OpenCV for Windows - 3.4.9
- OpenCV Python Library - 4.4.0
- Numpy - 1.18.1
- Serial Library in Python - 3.4
- Dataset for training was generated by capturing images from the webcam of the laptop and saving them using capture_images.py
- opencv_annotation.exe was used to mark out the regions containing fire in positive training images.
- positives.vec file was generated using opencv_createsamples using appropriate width and height parameters.
- Classifier was trained using opencv_traincascade and cascade.xml file was produced as an output.
- Arduino is connected to a USB port of computer.
- Python script communicates its output to Arduino through the USB port.
- Arduino starts pumping water to extinguish fire, buzzer and LEDs are turned on and the owner of the place is alerted via SMS.