def test_grid():
m = StupidMonkey({'touch':10})
poss = []
while True:
pos = m.get_touch_point()
if not pos:
break
poss.append(pos)
print 'grid point count:', len(poss)
import cv2
import numpy
img = numpy.zeros((1920, 1080))
for x,y in poss:
img[x,y] = 255
img = cv2.resize(img, (540, 960))
cv2.imshow('grid', img)
cv2.waitKey()
评论列表
文章目录