detectandtrack坐标显示

版权声明:添加我的微信wlagooble,开启一段不一样的旅程 https://blog.csdn.net/nineship/article/details/83653803

import matplotlib.pyplot as plt
import matplotlib.image as mpimg

I = mpimg.imread('quan.jpg')

x = [366.48068   , 364.48422   , 360.49133   , 399.42212   ,
        330.54456   , 461.3121    , 267.65637   , 466.30325   ,
        266.65814   , 469.2979    , 262.66522   , 412.39905   ,
        311.57828   , 416.39197   , 301.59604   , 429.3689    ,
        285.62442]

y = [139.5       , 191.5       ,  66.5       , 125.5       ,
        113.5       , 234.5       , 234.5       , 391.5       ,
        387.5       , 512.5       , 506.5       , 498.5       ,
        498.5       , 727.5       , 716.5       , 911.5       ,
        913.5 ]
 
x_show = x[:]
y_show = y[:]

fig = plt.figure()
ax = fig.add_subplot(111)


t_x1 = 245.19629
t_y1 = 0
t_x2 = 491.758
t_y2 = 999
t_lenx = t_x2-t_x1
t_leny = t_y2-t_y1

thread = 25
t1_x1 = 257.66522216796875-thread 
t1_y1 = 61.5-thread 
t1_x2 = 474.29791259765625+thread 
t1_y2 = 918.5+2*thread 
t1_lenx = t1_x2-t1_x1
t1_leny = t1_y2-t1_y1

rect = plt.Rectangle

((t_x1,t_y1),t_lenx,t_leny,linewidth=1,edgecolor='r',facecolor='none')

rect1 = plt.Rectangle

((t1_x1,t1_y1),t1_lenx,t1_leny,linewidth=1,edgecolor='b',facecolor='none')

ax.add_patch(rect)
ax.add_patch(rect1)
plt.plot(x_show, y_show,'r*')
plt.imshow(I)
plt.show()

手部:9,10

头顶:2

鼻子:0

猜你喜欢

转载自blog.csdn.net/nineship/article/details/83653803
今日推荐