当前位置: 首页 > news >正文

一站式营销推广做pc端网站适配

一站式营销推广,做pc端网站适配,诸城网站开发,搜索引擎的优化方法有哪些程序示例精选 Python入口顶部人体检测统计进出人数 如需安装运行环境或远程调试,见文章底部个人QQ名片,由专业技术人员远程协助! 前言 这篇博客针对《Python入口顶部人体检测统计进出人数》编写代码,代码整洁,规则&a…

程序示例精选
Python入口顶部人体检测统计进出人数
如需安装运行环境或远程调试,见文章底部个人QQ名片,由专业技术人员远程协助!

前言

这篇博客针对《Python入口顶部人体检测统计进出人数》编写代码,代码整洁,规则,易读。 学习与应用推荐首选。


运行结果

运行结果


文章目录

一、所需工具软件
二、使用步骤
       1. 主要代码
       2. 运行结果
三、在线协助

一、所需工具软件

       1. Python
       2. Opencv

二、使用步骤

代码如下(示例):

# -*- coding: utf-8 -*-
"""
Created on Wed Jul  4 16:19:10 2018@author: Akshay Narla
Working well with little error. Can't be tweaked by the user himself. 
The Person program can be copied here or be imported according to the requirement.
"""import datetime
import numpy as np
import cv2 as cvdef nothing(x):pass
#video capture
var=cv.VideoCapture('sample-02.mp4')
fgbg = cv.bgsegm.createBackgroundSubtractorMOG()
EntranceCounter= 0
ExitCounter= 0
frame_width= var.get(3)
frame_height= var.get(4)
res = (frame_height * frame_width)
# Calculate the min and max size of the object
min_areaTH = res / 40
max_areaTH = res / 3
# Bottom line
bottom = int(3 * (frame_height / 5))
pt1 =  [0, bottom]
pt2 =  [frame_width, bottom]
pts_L1 = np.array([pt1, pt2], np.int32)
pts_L1 = pts_L1.reshape((-1, 1, 2))
bottom_color = (255, 0, 0)
# Top line
top = int(2*(frame_height / 5))
pt3 =  [0,top]
pt4 =  [frame_width, top]
ret, mask = var.read()
while (var.isOpened()):
#if grabbed enter loop else break    ret, frame = var.read()if not ret:text = "No Video"break
#adjusting frame size and blurring  absd =  cv.absdiff(frame, mask)gray= cv.cvtColor(absd,cv.COLOR_BGR2GRAY, cv.CV_8UC1)resize = cv.GaussianBlur( gray,(21,21),0)
#background subtractionfgmask= fgbg.apply(resize)ret, th3 = cv.threshold(fgmask ,25,200,cv.THRESH_BINARY+cv.THRESH_OTSU)ret, th3 = cv.threshold(dil,0,50,cv.THRESH_BINARY+cv.THRESH_OTSU)
#contours and tracking    im2, contours, hierarchy = cv.findContours(th3.copy(), cv.RETR_EXTERNAL, cv.CHAIN_APPROX_SIMPLE)cv.drawContours(im2, contours, -1, (200,50,50), 2)
#grab all contours and draw rectangles and their centroids in original frame    for c in contours:area= cv.contourArea(c)if area> min_areaTH and area<max_areaTH:M = cv.moments(c)cx = int(M['m10']/M['m00'])cy = int(M['m01']/M['m00'])(x,y,w,h)= cv.boundingRect(c)new = True#tracking functionfor i in persons:        # If the object is close to already detectedif abs(cx-i.getX()) <= w and abs(cy-i.getY()) <= h:new = False# Update coordinates for better trackingi.updateCoords(cx,cy)# Check crossing and update Counterif i.UP(bottom,top) == True:EntranceCounter += 1elif i.DOWN(bottom, top) == True:ExitCounter += 1if i.timedOut():index = persons.index(i)persons.pop(index)del iif new == True:p = Person.MyPerson(cx, cy)persons.append(p)
#display the outputframe = cv.polylines(frame,[pts_L1], False, bottom_color, thickness = 1)frame = cv.polylines(frame,[pts_L2], False, top_color,thickness = 1)cv.putText(frame, "In:"+format(str(EntranceCounter)),(10,20),cv.FONT_HERSHEY_SIMPLEX,.5,(0,0,0))cv.putText(frame, "Out:"+format(str(ExitCounter)),(10,35),cv.FONT_HERSHEY_SIMPLEX,.5,(0,0,0))cv.putText(frame, datetime.datetime.now().strftime("%A %d %B %Y %I:%M:%S%p"),(10, frame.shape[0] - 10), cv.FONT_HERSHEY_SIMPLEX, 0.35, (255, 0, 0), 1)cv.putText(frame, "Inside:"+format(str(EntranceCounter-ExitCounter)),(10,50),cv.FONT_HERSHEY_SIMPLEX,.5,(255,255,255))cv.imshow('Panel', frame)if cv.waitKey(10) & 0xFF==ord('q'):break
var.release()
cv.destroyAllWindows()
运行结果

运行结果
运行结果

三、在线协助:

如需安装运行环境或远程调试,见文章底部个人 QQ 名片,由专业技术人员远程协助!

1)远程安装运行环境,代码调试
2)Visual Studio, Qt, C++, Python编程语言入门指导
3)界面美化
4)软件制作
5)云服务器申请
6)网站制作

当前文章连接:https://blog.csdn.net/alicema1111/article/details/132666851
个人博客主页:https://blog.csdn.net/alicema1111?type=blog
博主所有文章点这里:https://blog.csdn.net/alicema1111?type=blog

博主推荐:
Python人脸识别考勤打卡系统:
https://blog.csdn.net/alicema1111/article/details/133434445
Python果树水果识别:https://blog.csdn.net/alicema1111/article/details/130862842
Python+Yolov8+Deepsort入口人流量统计:https://blog.csdn.net/alicema1111/article/details/130454430
Python+Qt人脸识别门禁管理系统:https://blog.csdn.net/alicema1111/article/details/130353433
Python+Qt指纹录入识别考勤系统:https://blog.csdn.net/alicema1111/article/details/129338432
Python Yolov5火焰烟雾识别源码分享:https://blog.csdn.net/alicema1111/article/details/128420453
Python+Yolov8路面桥梁墙体裂缝识别:https://blog.csdn.net/alicema1111/article/details/133434445

http://www.yayakq.cn/news/282858/

相关文章:

  • 医院网站必须建设吗网络营销经典失败案例
  • 重庆规模最大的建网站公司哪个网站可以学做咸菜
  • 做毕业网站的流程dedecms 子网站
  • 网站打开速度多少时间启东做网站
  • 一流本科专业建设点网站如何推广网站运营
  • 北京seo优化厂家seo怎么去优化
  • 北京网站建设 云智互联十大最免费软件排行榜
  • 免费注册建网站如何手机创建网站
  • 像饿了码的网站建站有吗昆明企业网站开发公司
  • 站长查询站长工具百度快照怎么打开
  • 东莞网站模板难道做网站必须用vue框架吗
  • 自己做的网站如何让别人看到上海外贸网站建设公司价格
  • 网站模板 psd5118
  • 武平县天恒建设投资集团公司网站网站开发支付超时如何解决
  • 网站建设有哪种方式有名的公关公司
  • 免费的网站管理系统徐州建设安全监督网站
  • 网站空间域名是什么网络公司哪个效果好
  • wordpress主题 dux主题5.3seo行业岗位有哪些
  • 营销网站建设维护青岛贸易公司 网站制作
  • 丰台手机网站建设江西省建设工程安全质量监督管理局网站
  • 做好网站功能性建设工作网站扁平化结构和树形结构
  • 网站制作自己iis7架设网站教程
  • 控制面板网站html5网站建设思路
  • 网站建设 租赁上海外贸公司外滩27号
  • 电子政务网站建设方案网页配色设计手册
  • asp网站整站下载器长安区建设局网站
  • 贵州新农村建设专业网站网站开发重要性
  • 西宁网站建设最好的公司网站站长seo推广
  • 网站模板出售凡科做网站怎么样
  • 商城版免费网站卸载wordpress插件