我只是使用测距拓展板,看看TOF的准确度怎么样,为什么老是报这个错误,连接是没有问题的,先是有数据然后就报错
from machine import I2C
from vl53l1x import VL53L1X
import time
i2c = I2C(2)
distance = VL53L1X(i2c)
while True:
print("range: mm ", distance.read())
time.sleep_ms(50)
我只是使用测距拓展板,看看TOF的准确度怎么样,为什么老是报这个错误,连接是没有问题的,先是有数据然后就报错
from machine import I2C
from vl53l1x import VL53L1X
import time
i2c = I2C(2)
distance = VL53L1X(i2c)
while True:
print("range: mm ", distance.read())
time.sleep_ms(50)
我的是OPENMV4PLUS,想寻电线,使用VGA像素,为什么找出的是线段这个样子,哪里做的不对
def Line_Find_Fit(img):
for l in img.find_lines(roi=Middle_Roi, threshold=800, y_stride=20, theta_margin=10, rho_margin=10):
if ((l.theta() >= min_degree) and (l.theta() <= max_degree)):#and (l.length() >= 20)
img.draw_line(l.line(), color = (255, 0, 0))
best_line = l
PoleAndLine.Line_flag = 1
PoleAndLine.Line_y = (best_line.y1() + best_line.y2())/2
print(PoleAndLine.Line_y)
return best_line
else:
PoleAndLine.Line_flag = 0
@kidswong999 跑例程就是这样的效果
![0_1626268143648_20f1c5b4-917b-4328-8232-f8e2bfb0ca7d-image.png](正在上传 99%)
# Hello World Example
#
# Welcome to the OpenMV IDE! Click on the green run arrow button below to run the script!
import sensor, image, time
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240)
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.
print(clock.fps()) # Note: OpenMV Cam runs about half as fast when connected
感觉过头了,白天好一些,色块经常都不灵,openmv4就感觉还正常
实际灯挺亮的
下面是openmv4的图像
代码里面白平衡,曝光什么的也开了,没什么效果
plus就这样的吗,还是我哪里做的不对