和距离有关系,不是确定的值。越近这个值就越小,越远这个值就越大。你可以通过数尺子上像素数来确定。
小智智
@kidswong999
58
Reputation
11685
Posts
12397
Profile views
210
Followers
1
Following
Posts made by kidswong999
-
RE: 当图像大小设置为QVGA时,一个像素点的实际尺寸为多大?
-
RE: 电赛E题,识别“黑色矩形边框”例程(find_rects)修改而来,但是修改后"黑色矩形边框"识别率低,甚至误识别
import time, sensor from pyb import UART sensor.reset() sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QQVGA) sensor.set_windowing((120, 120)) sensor.set_auto_whitebal(True) sensor.skip_frames(time = 20) sensor.set_hmirror(False) sensor.set_vflip(True) while True: img = sensor.snapshot() rects = img.find_rects(threshold = 200) #ROI=(80, 60, 80, 60) for r in rects: rect = r.rect() # if (rect[0] > 15 and rect[1] > 15 # and rect[2] < 60 and rect[3] < 60 # and (rect[0] + rect[2]) < 100 # and (rect[1] + rect[3]) < 100 # and (rect[0] + rect[2]) > 25 # and (rect[1] + rect[3]) > 25): img.draw_rectangle(rect, color = (255, 0, 0)) corner = r.corners() for point in r.corners(): img.draw_circle(point[0], point[1], 5, color = (0, 255, 0))
-
RE: 电赛E题,识别“黑色矩形边框”例程(find_rects)修改而来,但是修改后"黑色矩形边框"识别率低,甚至误识别
if (rect[0] > 15 and rect[1] > 15
and rect[2] < 60 and rect[3] < 60
and (rect[0] + rect[2]) < 100
and (rect[1] + rect[3]) < 100
and (rect[0] + rect[2]) > 25
and (rect[1] + rect[3]) > 25):这句话的作用是什么?是不是这一堆判断写错了,把它删掉看看。