logo

板子异常,经过调试发现,同一套程序同一型号的2个openmv4_Plus板子运行后帧率输出不一致,现想知道如何解决

2021-12-15 13:44
T
atyw
# Hello World Example
#
# Welcome to the OpenMV IDE! Click on the green run arrow button below to run the script!

import sensor, image, time
from pyb import UART
def angle_rho_print(line_in):
    if line_in.theta()>90:
        angle=line_in.theta()-180
    else:
        angle=line_in.theta()
    rho_err=abs(line_in.rho())-160
    print("angle=",angle)
    print("rho_err=",rho_err)

uart = UART(3, 115200, timeout_char=1000)
#low_threshold=(220,255)
low_threshold=(0, 100, -127, -15, -13, 63)
ROI_QVGA=(120,20,120,200)
ROI_QQVGA=(60,10,60,100)
sensor.reset()                      # Reset and initialize the sensor.
#sensor.set_vflip(True)              #水平方向翻转
#sensor.set_hmirror(True)             #垂直方向翻转

#sensor.set_pixformat(sensor.GRAYSCALE)#设置像素模式,GRAYSCALE:灰度,RGB565:彩色
sensor.set_pixformat(sensor.RGB565)#设置像素模式,GRAYSCALE:灰度,RGB565:彩色
sensor.set_framesize(sensor.QQVGA)      # 设置像素大小:SVGA: 800x600  VGA: 640x480 QQQVGA:80x60
                                      #QVGA: 320x240 QQVGA: 160x120
sensor.skip_frames(time = 2000)     # Wait for settings take effect.
clock = time.clock()                # Create a clock object to track the FPS.

while(True):
    clock.tick()                    # Update the FPS clock.

    img = sensor.snapshot()         # Take a picture and return the image.
    img.binary([low_threshold])
    #line = img.get_regression([low_threshold],False,robust = True)
    line = img.get_regression([(100,100)], robust = True)
    if (line):
        img.draw_line(line.line(), color = 127)
        #if uart.any():
        data=uart.readline()
        if line.theta()>90:
            angle=line.theta()-180
        else:
            angle=line.theta()
        rho_err=abs(line.rho())-160
        out_str="[%d,%d]"%(angle,rho_err)
           #uart.write(out_str)
        print("angle=",angle)
        print("rho_err=",rho_err)
        print("帧率=",clock.fps())
4cb7e5a0-2b29-4abc-8020-fd870c1003f7.jpg
0a982cf9-bc02-4b01-af8c-b46485cf07dc.jpg
ea5f37e7-72b6-40d9-8e5b-2d2258195efa.jpg
29db1fac-f573-45b7-b27f-e5991d02be6b.jpg
e9ce2f8d-6c98-4478-993a-44c168feb979.jpg
b523190f-a982-43e7-b386-d3ee3bdc462c.jpg
2021-12-16 18:11
I
网红小智智 星瞳科技

固件版本一致吗,都是多少?