【OpenCV】使用Python和OpenCV实现火焰检测

1、 项目源码和结构(转) 

https://github.com/mushfiq1998/fire-detection-python-opencv

2、 运行环境

# 安装playsound:用于播放报警声音

pip install playsound

# 安装opencv-python:cv2用于图像和视频处理,特别是用于检测火灾

pip install opencv-python

3、 fireDetection.py

import cv2         # Library for openCV
import threading   # Library for threading -- which allows code to run in backend
import playsound   # Library for alarm sound
import smtplib     # Library for email sending

# To access xml file which includes positive and negative images of fire. 
# (Trained images) File is also provided with the code.
fire_cascade = cv2.CascadeClassifier('fire_detection_cascade_model.xml')

# To start camera this com
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值