logo

怎么插入多模板匹配(或者特征点检测)然后通过串口发送数据,每次添加东西都会不匹配外部缩进

2020-04-28 07:31
F
子非鱼
from pyb import UART
import json
white_threshold   = (   40,   99,  -6,   17,   -11,   16)
red_threshold	 = (   32,   55,  30,   64,   8,   38)
self_threshold	= (   60,   78,  20,   47,   10,   45)
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QQVGA)
sensor.skip_frames(10)
sensor.set_auto_whitebal(False)
clock = time.clock()
uart = UART(3, 115200)
def find_max(blobs):
	max_size=10
	for blob in blobs:
		if blob.pixels() > max_size:
			max_blob=blob
			max_size = blob.pixels()
	return max_blob
while(True):
	img = sensor.snapshot()
	blobs = img.find_blobs([white_threshold])
	output_str = json.dumps(blobs)
	if blobs:
		for b in blobs:
			img.draw_rectangle(b[0:4])
			img.draw_cross(b[5], b[6])
			max_blob=find_max(blobs)
2020-04-29 19:21
I
网红小智智 星瞳科技

我没看懂你具体要做什么。。。

I
网红小智智 星瞳科技

我也没看懂你的代码要做什么。。。