• 大小: 24.38MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-28
  • 语言: 其他
  • 标签: 无碳小车  

资源简介

物料搬运机器人所有资料。不过少了一些视频。2018年时候的资料。 博客介绍在这里 https://blog.csdn.net/weixin_42089190/article/details/83964375

资源截图

代码片段和文件信息

# all - By: 24109 - 周日 10月 7 2018
#第一部分,识别二维码
#串口一定要5V的电压
import sensor image time
from pyb import UART
sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
sensor.set_auto_gain(False) # must turn this off to prevent image washout...
uart = UART(3 115200)
uart.init(115200 bits=8 parity=None stop=1) # init with given parameters
#Flag = 1
while not uart.any():#0
    img = sensor.snapshot()
    img.lens_corr(1.8) # strength of 1.8 is good for the 2.8mm lens.
    #uart.write(“hello\r\n“)
    #print(“hello“)
    for code in img.find_qrcodes():
        img.draw_rectangle(code.rect() color = (255 0 0))
        uart.write(“Q“)      #分开发送会不会有影响
        uart.write(code.payload())
        uart.write(“\r\n“)
        print(code.payload())
        #Flag = 0
# 如果要保证颜色追踪效果的话, 需要对环境的严格控制
# 晚上光源的冷暖色等,都会对颜色追踪造成很大的影响

# 彩色图片颜色的阈值格式组成, 是由LAB颜色空间的各自最小值与最大值组成
# 点击右侧的颜色空间下拉选择按钮, 默认为RGB Color Space
# 参考右侧的LAB Color Space里面的参数
# (minL maxL minA maxA minB maxB)
# 灰度图的阈值格式
# (min max)
# 红色阈值
#第二部分,识别三个物料位置
red_threshold =(20 72 28 92 14 127)
# 绿色阈值
green_threshold = (39 93 -71 -28 -22 67)
blue_threshold = (16 60 -46 16 -68 -30)
# 颜色阈值的设定可以在 工具(Tools) -> 机器视觉(Machine Vision) -> 阈值编辑器(Threshold Editor) 中调试





# 颜色代码是find_blobs返回的blob对象中的一个成分, 用于标识,该色块是由在哪个阈值下选择的
# 颜色1: 红色的颜色代码
red_color_code = 1 # code = 2^0 = 1
# 颜色2: 绿色的颜色代码
green_color_code = 2 # code = 2^1 = 2
# 颜色3的代码
blue_color_code = 4   # 2^2 = 4
# 颜色4的代码
# color_code_4 = 2^3 = 8
sensor.reset() # 初始化摄像头         #一定别忘了改回RGB565
sensor.set_pixformat(sensor.RGB565) # 选择像素模式 RGB565.
sensor.set_framesize(sensor.QQVGA) # use QQVGA for speed.
sensor.skip_frames(10) # Let new settings take affect.
sensor.set_auto_whitebal(False) #关闭白平衡。白平衡是默认开启的,在颜色识别中,需要关闭白平衡。
red_co = 1    #必须要定义,否则会有语法错误
green_co = 1
blue_co = 1
Flag = 1
#time.sleep(3000)#停滞一段时间,不管用
#uart.read([12])
while 1:#not uart.any():#此处的判断条件不应该再次是串口接收数据了,因为它可能把之前的数据误当作此处条件
    #print(“sss“)
    #uart.write(“sss\r\n“)
    if uart.any():
        tmp_data = uart.readchar()
        if tmp_data == 0x33:
            break
    img = sensor.snapshot() # 拍照,返回图像
            #uart.write(“RECIVED : %c\n“%tmp_data)
    # 在图像中寻找满足颜色阈值约束(color_threshold 数组格式) 像素阈值pixel_threshold, 色块面积大小阈值(area_threshold)的色块
    blobs = img.find_blobs([red_threshold green_threshold blue_threshold] area_threshold=100)
    if blobs: #and blobs[0].area() >400 and blobs[1].area() > 400 and blobs[2].area() > 400:#len(blobs) == 3 and blobs[0].area() >700 and blobs[1].area() > 700 and blobs[2].area() > 700:#blobs.area()> 700:                #约束要充分
    #如果找到了目标颜色‘‘‘and len(blobs) == 3 ‘‘‘
        #Flag = 0
        for blob in blobs:
            if blob.area()>300:
                color_code = blob[8] # 颜色代码
                # 添加颜色说明

                x = blob[0]
                y = blob[1] #
                width = blob[

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       6394  2018-11-03 00:14  整车资料\open mv程序\allV4.py

     文件       6395  2018-11-02 09:13  整车资料\open mv程序\allV5.py

     文件       3419  2018-10-31 22:22  整车资料\open mv程序\color_j.py

     文件       3142  2018-09-13 17:32  整车资料\open mv程序\color_jV1.py

     文件        894  2018-10-03 09:19  整车资料\open mv程序\qrcode_uart.py

     文件        664  2018-10-31 21:45  整车资料\open mv程序\uart.py

     文件         17  2018-11-11 17:35  整车资料\open mv程序\程序.txt

     文件       7437  2018-10-22 16:59  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\CONTROL\control.c

     文件        551  2018-10-22 16:35  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\CONTROL\control.h

     文件       2091  2018-10-29 11:58  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\CONTROL\dataprocess.c

     文件        213  2018-10-14 16:17  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\CONTROL\dataprocess.h

     文件       2667  2016-01-02 12:45  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\CONTROL\DataScope_DP.C

     文件        364  2016-01-02 12:45  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\CONTROL\DataScope_DP.h

     文件       3617  2018-11-02 18:18  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\CONTROL\dongzuo.c

     文件        121  2018-10-19 20:07  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\CONTROL\dongzuo.h

     文件       3802  2018-10-26 21:24  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\CONTROL\SHOW\show.c

     文件        328  2018-09-28 13:34  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\CONTROL\SHOW\show.h

     文件      16394  2018-11-02 00:43  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\CONTROL\steercontrol.c

     文件       1145  2018-10-29 12:15  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\CONTROL\steercontrol.h

     文件      17273  2010-06-07 10:25  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\CORE\core_cm3.c

     文件      85714  2011-02-09 14:59  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\CORE\core_cm3.h

     文件      15503  2011-03-10 10:52  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\CORE\startup_stm32f10x_hd.s

     文件       1982  2018-10-04 22:54  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\HARDWARE\ADC\adc.c

     文件        471  2018-06-10 02:12  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\HARDWARE\ADC\adc.h

     文件       1950  2018-10-04 22:55  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\HARDWARE\DMA\dma.c

     文件        187  2018-06-11 16:05  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\HARDWARE\DMA\dma.h

     文件      19342  2012-12-14 11:16  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\HARDWARE\DMP\dmpKey.h

     文件       6765  2012-12-14 11:16  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\HARDWARE\DMP\dmpmap.h

     文件      84104  2015-07-09 14:05  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\HARDWARE\DMP\inv_mpu.c

     文件       4335  2015-07-09 14:05  整车资料\stm32f103程序\无碳小车 - V6.0\无碳小车 - V6.0\HARDWARE\DMP\inv_mpu.h

............此处省略663个文件信息

评论

共有 条评论