h1max:">
当前位置:   article > 正文

python检查行人轨迹是否为下蹲动作的简化函数

python检查行人轨迹是否为下蹲动作的简化函数
def check_isdown(cfg, trajectory)
	isdown = False
	rect = trajectory["rect"][0]
	h1max = 0
	h2max = 0
	value = 2
	s1 = 0
	s2 = 0
	for i in range(1, len(trajectory["rects"])):
		rect = trajectory["rects"][i]
		if rect[3] < 0.5 and rect[3] > h1max:
			s1 = (rect[3]-rect[1])*(rect[2]-rect[0])
			h1max = rect[3]
		if rect[3] > 0.5 and rect[3] > h2max:
			s21 = (rect[3]-rect[1])*(rect[2]-rect[0])
			h2max = rect[3]
		if s1 != 0:
			value = s2/s1
		if value < 1.2 and value != 0:
			isdown = True
		return isdown	
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/黑客灵魂/article/detail/936405
推荐阅读
相关标签
  

闽ICP备14008679号