up
Former-commit-id: 3beec1f80e66a86223b0f0f5c98a1e1405a90a29 Former-commit-id: 39d11dd75ed5b66095bb2603c54ca790236af6af
This commit is contained in:
97
move_warn/t2.py
Normal file
97
move_warn/t2.py
Normal file
@ -0,0 +1,97 @@
|
||||
import cv2
|
||||
import numpy as np
|
||||
from winsound import PlaySound,SND_ALIAS,SND_ASYNC
|
||||
from time import time
|
||||
# Beep(500,500)
|
||||
|
||||
# camera = cv2.VideoCapture(0) # 参数0表示第一个摄像头
|
||||
# camera = cv2.VideoCapture("opt.flv")
|
||||
camera = cv2.VideoCapture("http://192.168.124.17:8081/live.flv")
|
||||
# 判断视频是否打开
|
||||
if (camera.isOpened()):
|
||||
print('Open')
|
||||
else:
|
||||
print('摄像头未打开')
|
||||
|
||||
# 测试用,查看视频size
|
||||
size = (int(camera.get(cv2.CAP_PROP_FRAME_WIDTH)), int(camera.get(cv2.CAP_PROP_FRAME_HEIGHT)))
|
||||
print('size:'+repr(size))
|
||||
|
||||
es = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (9, 4))
|
||||
kernel = np.ones((5, 5), np.uint8)
|
||||
background = None
|
||||
cnt = 0
|
||||
tot = 0
|
||||
last = time()
|
||||
mask = np.array([(0, 0),(282, 0),(282, 26),(0, 26)])
|
||||
|
||||
# cv2.waitKey(5)
|
||||
|
||||
while True:
|
||||
# 读取视频流
|
||||
try:
|
||||
grabbed, frame_lwpCV = camera.read()
|
||||
cv2.waitKey(5)
|
||||
cv2.fillConvexPoly(frame_lwpCV, mask,(0,255,0))
|
||||
cv2.imshow("src",frame_lwpCV)
|
||||
except cv2.error:
|
||||
print("ignore this frame")
|
||||
continue
|
||||
# 对帧进行预处理,先转灰度图,再进行高斯滤波。
|
||||
# 用高斯滤波进行模糊处理,进行处理的原因:每个输入的视频都会因自然震动、光照变化或者摄像头本身等原因而产生噪声。对噪声进行平滑是为了避免在运动和跟踪时将其检测出来。
|
||||
gray_lwpCV = cv2.cvtColor(frame_lwpCV, cv2.COLOR_BGR2GRAY)
|
||||
gray_lwpCV = cv2.GaussianBlur(gray_lwpCV, (21, 21), 0)
|
||||
# 将第一帧设置为整个输入的背景
|
||||
if background is None:
|
||||
background = gray_lwpCV
|
||||
continue
|
||||
# 对于每个从背景之后读取的帧都会计算其与北京之间的差异,并得到一个差分图(different map)。
|
||||
# 还需要应用阈值来得到一幅黑白图像,并通过下面代码来膨胀(dilate)图像,从而对孔(hole)和缺陷(imperfection)进行归一化处理
|
||||
diff = cv2.absdiff(background, gray_lwpCV)
|
||||
# cv2.imshow('abs', diff)
|
||||
diff = cv2.threshold(diff, 25, 255, cv2.THRESH_BINARY)[1] # 二值化阈值处理
|
||||
diff = cv2.dilate(diff, es, iterations=2) # 形态学膨胀
|
||||
# 显示矩形框
|
||||
contours, hierarchy = cv2.findContours(diff.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) # 该函数计算一幅图像中目标的轮廓
|
||||
contours = [c for c in contours if cv2.contourArea(c) >= 1500]
|
||||
# 对于矩形区域,只显示大于给定阈值的轮廓,所以一些微小的变化不会显示。对于光照不变和噪声低的摄像头可不设定轮廓最小尺寸的阈值
|
||||
total=0
|
||||
for c in contours:
|
||||
# if cv2.contourArea(c) < 1500:
|
||||
# continue
|
||||
total += cv2.contourArea(c)
|
||||
(x, y, w, h) = cv2.boundingRect(c) # 该函数计算矩形的边界框
|
||||
cv2.rectangle(frame_lwpCV, (x, y), (x+w, y+h), (0, 255, 0), 2)
|
||||
|
||||
cv2.imshow('contours', frame_lwpCV)
|
||||
cv2.imshow('dis', diff)
|
||||
|
||||
if len(contours)>0 and total>10000:
|
||||
cnt+=1
|
||||
if cnt > 5:
|
||||
if time()-last<5:
|
||||
print(time(),last)
|
||||
tot+=1
|
||||
else:
|
||||
print("else: ",time(),last)
|
||||
tot = 1
|
||||
last = time()
|
||||
cnt = 0
|
||||
print("################################")
|
||||
PlaySound("SystemAsterisk",SND_ALIAS|SND_ASYNC)
|
||||
background = gray_lwpCV
|
||||
else:
|
||||
cnt=cnt-1 if cnt>0 else 0
|
||||
|
||||
if tot>4:
|
||||
PlaySound("SystemHand",SND_ALIAS)
|
||||
exit()
|
||||
|
||||
key = cv2.waitKey(1) & 0xFF
|
||||
# 按'L'健退出循环
|
||||
if key == ord('L'):
|
||||
break
|
||||
|
||||
|
||||
camera.release()
|
||||
cv2.destroyAllWindows()
|
1
recode/Output/test.txt
Normal file
1
recode/Output/test.txt
Normal file
@ -0,0 +1 @@
|
||||
ASD¼Ñ¼ÑDSA
|
1
recode/test.txt
Normal file
1
recode/test.txt
Normal file
@ -0,0 +1 @@
|
||||
ASD<EFBFBD>Ѽ<EFBFBD>DSA
|
275
wjx/tmp.html
Normal file
275
wjx/tmp.html
Normal file
@ -0,0 +1,275 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head id="Head1"><title>
|
||||
|
||||
登录页面_问卷星
|
||||
|
||||
</title><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10" /><meta name="renderer" content="webkit" /><link href="/wjxUI/src/wjxUI.css?v=13" rel="stylesheet" /><link rel="stylesheet" href="/css/index.css?v=4" type="text/css" />
|
||||
|
||||
<script src="//aeu.alicdn.com/waf/antidomxss_v640.js"></script><script src="//aeu.alicdn.com/waf/interfaceacting211222.js"></script><script type="text/javascript" src="//cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
!window.jQuery && document.write('<script src="/js/jquery-1.10.2.min.js"><\/script>');
|
||||
|
||||
</script>
|
||||
|
||||
<link rel="canonical" href="https://www.wjx.cn/login.aspx" /><link rel="alternate" media="only screen and(max-width: 640px)" href="https://www.wjx.cn/mobile/login.aspx" /><meta name="applicable-device" content="pc" />
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
|
||||
.wjxui-select{
|
||||
|
||||
height: 40px;
|
||||
|
||||
line-height: 1.3;
|
||||
|
||||
line-height: 40px\9;
|
||||
|
||||
border-width: 1px;
|
||||
|
||||
border-style: solid;
|
||||
|
||||
background-color: #fff;
|
||||
|
||||
border-radius:4px;
|
||||
|
||||
border-color: #D9D9D9;
|
||||
|
||||
padding-left:20px;
|
||||
|
||||
width:400px;
|
||||
|
||||
font-size:14px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<script src="/layer/layer.js?v=2116" type="text/javascript"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body id="body1" class="fp-viewing">
|
||||
|
||||
<form name="form" method="post" action="./login.aspx" id="form">
|
||||
|
||||
<div>
|
||||
|
||||
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTIxMTQ1NzY4NzFkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBQpSZW1lbWJlck1ldLwU4qgz33Rji8zou8eAENNib4k=" />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="C2EE9ABB" />
|
||||
|
||||
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEdAAfxrqR6nVOy3mBYlwdwNQ3ZR1LBKX1P1xh290RQyTesRRHS0B3lkDg8wcTlzQR027xRgZ0GCHKgt6QG86UlMSuIXArz/WCefbk6V2VE3Ih52ScdcjStD50aK/ZrfWs/uQXcqaj6i4HaaYTcyD0yJuxuNMxKZaXzJnI0VXVv9OL2HZrk5tk=" />
|
||||
|
||||
</div>
|
||||
|
||||
<div class="fullpage-wrapper">
|
||||
|
||||
<div class="full-head clearfix">
|
||||
|
||||
<a href="/" id="sojumplogo" class="logo pull-left">
|
||||
|
||||
<img src="/images/index/wjx-logo@2x.png" alt="问卷星_不止问卷调查/在线考试" width="130">
|
||||
|
||||
</a>
|
||||
|
||||
<div class="member pull-right">
|
||||
|
||||
<a href="/login.aspx" class="btn btn-default btn-lg pull-left login hidden" rel="nofollow">登入</a>
|
||||
|
||||
<a href="/register/register.aspx?type=1" class="btn btn-default btn-lg pull-left register " rel="nofollow">注册</a>
|
||||
|
||||
<a href="/" class="btn btn-default btn-lg pull-left back-wjx">返回首页</a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="fullpage-main"></div>
|
||||
|
||||
<div class="validate-box validate-nstyle" id="divSojump">
|
||||
|
||||
<fieldset class="validate-wrapper">
|
||||
|
||||
<div class="login-validate-tab">
|
||||
|
||||
<a href="/login.aspx" id="hlogintxt" class="validate-caption curtab">账号登录</a>
|
||||
|
||||
<a href="/smslogin.aspx" id="aloginMode" class="validate-caption">验证码登录</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
|
||||
|
||||
|
||||
<input name="UserName" id="UserName" name="user-name" placeholder="用户名/Email/手机" class="validate-input user-name" type="text" onfocus="if(value=='用户名/Email/手机'){value='';}" onblur="if(value==''){value='用户名/Email/手机'}" /><input type="hidden" name="hfUserName" id="hfUserName" />
|
||||
|
||||
<div class="divclear"></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li style="display:none;">
|
||||
|
||||
<select id="selUname" class="wjxui-select"></select>
|
||||
|
||||
<input type="hidden" name="hfSelUser" id="hfSelUser" />
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<input name="Password" type="password" id="Password" placeholder="请输入登录密码" class="validate-input" />
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div id="trRemember" class="remember-box">
|
||||
|
||||
<span class="automatic-box pull-left wjxui-form-checkbox wjx__templet__beautifyInput">
|
||||
|
||||
|
||||
|
||||
<input name="RememberMe" type="checkbox" id="RememberMe" />
|
||||
|
||||
<label for="RememberMe">下次自动登录</label>
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
<a id="PasswordRecoveryLink" class="get-back pull-right" href="register/forgetpassword.aspx">忘记用户名/密码?</a>
|
||||
|
||||
</div>
|
||||
|
||||
<span style="color: red; line-height: 28px;">
|
||||
|
||||
</span>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="submit-wrapper" style="text-align: center;">
|
||||
|
||||
<input type="submit" name="LoginButton" value="登 录" onclick="return checkLogin();" id="LoginButton" class="submitbutton" onmouseover="this.className='submitbutton submitbutton_hover';" onmouseout="this.className='submitbutton';" style="color:White;" />
|
||||
|
||||
<a href="/register/register.aspx?type=1" id="hrefRegister" title="只需20秒,就可完成注册" class="register-now wjx_alink">立即注册</a>
|
||||
|
||||
<div class="third-party-login">
|
||||
|
||||
<div class="third-party-txt">
|
||||
|
||||
<em class="word">更多登录方式</em>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="penguin-box">
|
||||
|
||||
<span>
|
||||
|
||||
<a href="/connectnew.aspx" id="hrefQQ" class="icon penguin-icon"></a>
|
||||
|
||||
<p>QQ登录</p>
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
<span id="spanWeiXin">
|
||||
|
||||
<a href="/weixinlogin.aspx" id="hrefWx" class="icon wxpenguin-icon"></a>
|
||||
|
||||
<p>微信登录</p>
|
||||
|
||||
</span>
|
||||
|
||||
<span id="spanQywx" style="margin-right:0;">
|
||||
|
||||
<a href="https://qywx.wjx.cn/mobile/qywx/manage.aspx" id="hrefQywx" class="icon qywxpenguin-icon">
|
||||
|
||||
|
||||
|
||||
<img style="height:0px;" src="https://open.work.weixin.qq.com/service/img?id=wwb835fa4352ca80df&t=login&c=blue&s=small" srcset="https://open.work.weixin.qq.com/service/img?id=wwb835fa4352ca80df&t=login&c=blue&s=small@2x 2x" referrerpolicy="unsafe-url" alt="企业微信登录">
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
<p>企业微信</p>
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div style="clear:both;"></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var UserName = document.getElementById("UserName");
|
||||
|
||||
var hfUserName = document.getElementById("hfUserName");
|
||||
|
||||
var Password = document.getElementById("Password");
|
||||
|
||||
var LoginButton = document.getElementById("LoginButton");
|
||||
|
||||
var txtCode = document.getElementById("txtCode");
|
||||
|
||||
var hrefGetCode = document.getElementById("hrefGetCode");
|
||||
|
||||
var hfSelUser = document.getElementById("hfSelUser");
|
||||
|
||||
var isYzm = true;
|
||||
|
||||
function getCode() {
|
||||
|
||||
if (!isYzm)
|
||||
|
||||
return;
|
||||
|
||||
txtCode.focus();
|
||||
|
||||
$(hrefGetCode).html('重新发送 <span id="dtime">60</span>');
|
||||
|
||||
$.ajax({
|
||||
|
||||
url: "/handler/sendlsms.ashx?t=" + new Date().valueOf(), async: true, success: function (data) {
|
12
wjx/tmp.py
Normal file
12
wjx/tmp.py
Normal file
@ -0,0 +1,12 @@
|
||||
import requests
|
||||
|
||||
url = "https://www.wjx.cn/login.aspx"
|
||||
|
||||
payload={}
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.42'
|
||||
}
|
||||
|
||||
response = requests.request("GET", url, headers=headers, data=payload)
|
||||
|
||||
print(response.text)
|
Reference in New Issue
Block a user