![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
OpenMV
诺亚方包
这个作者很懒,什么都没留下…
展开
-
OpenMV >> 5. 颜色形状同时识别
以识别红色的圆形为例。首先我们进行圆形识别,然后在识别到的圆形区域内进行颜色统计,判断区域内最多的颜色是否是红色。import sensor, image, timesensor.reset()sensor.set_pixformat(sensor.RGB565)sensor.set_framesize(sensor.QQVGA)sensor.skip_frames(time = 20...原创 2019-08-02 15:44:09 · 8405 阅读 · 2 评论 -
OpenMV >> 6. 使用外设
常用函数# 延时50mspyb.delay(50)# 获取从启动开始计时的毫秒数pyb.millis()LEDfrom pyb import LEDled = LED(1) # 红ledled.toggle()led.on()#亮led.off()#灭LED(1) -> 红LEDLED(2) -> 绿LEDLED(3) -> 蓝LEDLED(4...原创 2019-08-02 16:28:01 · 1327 阅读 · 0 评论 -
OpenMV >> 1. 基本方法
获取/设置像素点通过image.get_pixel(x, y) 方法来获取一个像素点的值对于灰度图:返回(x, y) 坐标的灰度值;对于彩色图:返回(x, y) 坐标的(r, g, b) 的tuple。通过image.set_pixel(x, y) 方法来设置一个像素点的值对于灰度图:设置(x, y) 坐标的灰度值;对于彩色图:设置(x, y) 坐标的(r, g, b) 的值。...原创 2019-08-02 12:40:31 · 1752 阅读 · 0 评论 -
OpenMV >> 2. 使用图像的统计信息
StatisticsROI 感兴趣区域roi 的格式是**(x, y, w, h)** 的tupplex:ROI区域中左上角的x坐标;y:ROI区域中左上角的y坐标;w:ROI的宽度;h:ROI的高度。Statisticsimage.get_statistics(roi=Auto)其中roi 是目标区域。statistics.mean() 返回灰度的平均数(0-255) ...原创 2019-08-02 12:53:19 · 1188 阅读 · 0 评论 -
OpenMV >> 3. 画图
颜色可以是灰度值**(0-255),或者是彩色值(r, g, b)** 的tupple画线image.draw_line(line_tuple, color=White)line_tuple 的格式是**(x0, y0, x1, y1),意思是(x0, y0)** 到**(x1, y1)** 的直线。颜色可以是灰度值**(0-255),或者是彩色值(r, g, b)** 的tupple。...原创 2019-08-02 13:02:18 · 944 阅读 · 0 评论 -
OpenMV >> 4. 寻找色块
find_blobs 函数image.find_blobs(thresholds, roi=Auto, x_stride=2, y_stride=1, invert=False, area_threshold=10, pixels_threshold=10, merge=False, margin=0, threshold_cb=None, merge_cb=None)thresholds...原创 2019-08-02 14:53:37 · 2508 阅读 · 0 评论