OpenCV与AI深度学习 | 使用Python和OpenCV实现火焰检测(附源码)

本文来源公众号“OpenCV与AI深度学习”,仅用于学术分享,侵权删,干货满满。

原文链接:使用Python和OpenCV实现火焰检测(附源码)

完整项目源码下载:

https://github.com/mushfiq1998/fire-detection-python-opencv?source=post_page-----e55c8fc6fa54--------------------------------

图片:

项目结构:

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') 
vid = cv2.VideoCapture("videos\\fire2.mp4")
runOnce = False  # created boolean

# defined function to play alarm post fire detection using threading
def play_alarm_sound_function(): 
    # to play alarm # mp3 audio file is also pr
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值