12
Return list

3386

Posts

0

Resources
21
 
#MicroPython动手做(08)——零基础学MaixPy之识别颜色
#实验程序之三:find orange blob 动态识别橙色块

import sensor
import image
import lcd
import time

lcd.init(freq=15000000)

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.run(1)

orange_threshold  = (0, 80, 66, -20, 80, 50)

while True:
    img=sensor.snapshot()
    blobs = img.find_blobs([orange_threshold])
    if blobs:
        for b in blobs:
            tmp=img.draw_rectangle(b[0:4])
            tmp=img.draw_cross(b[5], b[6])
            c=img.get_pixel(b[5], b[6])

    lcd.display(img)

 
 

3386

Posts

0

Resources
22
 

 
 
 

3386

Posts

0

Resources
23
 

The blue LAB thresholds are 0, 80, -128, 35, -128, -18

 
 
 

3386

Posts

0

Resources
24
 

Yellow LAB thresholds are 88, 95, 0, -44, 93, 48

 
 
 

3386

Posts

0

Resources
25
 

Note:
This experimental case is based on the color of an ordinary Rubik's Cube (cloudy light), and the experimental data (LAB threshold) obtained is for reference only.

Blue (0, 80, -128, 35, -128, -18)
Red (55, 70, 42, 65, 52, 8)
Green (0, 88, -42, -6, -9, 13)
Orange (0, 80, 66, -20, 80, 50)
Yellow (88, 95, 0, -44, 93, 48)

 
 
 

3386

Posts

0

Resources
26
 

#MicroPython Hands-on (08) - Learn to recognize colors with MicroPython from scratch
# Experimental procedure 4: Recognize the red heart and flower heart parts on the picture

Open MaixPy IDE, select Tools - Machine Vision - Value Editor - Source Image Location - Image File (to recognize images on the computer)

Carefully adjust the values of the six sliders. The reference result is shown in the binary image below.
The LAB thresholds for identifying red hearts and flower hearts are (0, 80, 90, 24, 75, -10)

 
 
 

3386

Posts

0

Resources
27
 
#MicroPython动手做(08)——零基础学MaixPy之识别颜色
#实验程序之四:识别图片上的红心和花心部分

import sensor
import image
import lcd
import time

lcd.init(freq=15000000)

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.run(1)

Five_threshold  = (0, 80, 90, 24, 75, -10)

while True:
    img=sensor.snapshot()
    blobs = img.find_blobs([Five_threshold])
    if blobs:
        for b in blobs:
            tmp=img.draw_rectangle(b[0:4])
            tmp=img.draw_cross(b[5], b[6])
            c=img.get_pixel(b[5], b[6])

    lcd.display(img)

 
 
 

3386

Posts

0

Resources
28
 

 
 
 

3386

Posts

0

Resources
29
 

 
 
 

7462

Posts

2

Resources
30
 
Support one, I didn't expect to be able to play this effect

Comments

Thank you for the encouragement, teacher  Details Published on 2020-4-8 08:25
 
 
 

3386

Posts

0

Resources
31
 
freebsder posted on 2020-4-8 08:02 I support one, I didn't expect it to work like this

Thank you for the encouragement, teacher

 
 
 

3386

Posts

0

Resources
32
 

Table of Contents
MicroPython Hands-on (01) - I bought a K210 chip AI development board after the Spring Festival
https://bbs.eeworld.com.cn/thread-1115786-1-1.html

MicroPython Hands-on (02) - Try to build the IDE environment of K210 development board
https://bbs.eeworld.com.cn/thread-1115831-1-1.html

MicroPython Hands-on (03) - Learn to start and run MicroPython from scratch
https://bbs.eeworld.com.cn/thread-1116184-1-1.html

MicroPython Hands-on (04) - Basic examples of learning MicroPython from scratch
https://bbs.eeworld.com.cn/thread-1116438-1-1.html

MicroPython Hands-on (05) - Learn MicroPython from scratch - LCD screen
https://bbs.eeworld.com.cn/thread-1116577-1-1.html

MicroPython Hands-on (06) - Learn MaixPy from scratch for monocular camera
https://bbs.eeworld.com.cn/thread-1116591-1-1.html

MicroPython Hands-on (07) - Learn Machine Vision with MaixPy from Scratch
https://bbs.eeworld.com.cn/thread-1116617-1-1.html

MicroPython Hands-on (08) - Learn MaixPy from scratch to recognize colors
https://bbs.eeworld.com.cn/thread-1116662-1-1.html

MicroPython Hands-on (09) - Learn MaixPy face recognition from scratch
https://bbs.eeworld.com.cn/thread-1116720-1-1.html

MicroPython Hands-on (10) - Learn MaixPy Neural Network KPU from scratch
https://bbs.eeworld.com.cn/thread-1116925-1-1.html

MicroPython Hands-on (11) - Building the control board IDE environment
https://bbs.eeworld.com.cn/thread-1117964-1-1.html

MicroPython Hands-on (12) - Hello World on the Control Board
https://bbs.eeworld.com.cn/thread-1118180-1-1.html

MicroPython Hands-on (13) - RGB tricolor light of the control board
https://bbs.eeworld.com.cn/thread-1118275-1-1.html

MicroPython Hands-on (14) - OLED screen of the control board
https://bbs.eeworld.com.cn/thread-1118389-1-1.html

MicroPython Hands-on (15) - AB buttons on the control panel
https://bbs.eeworld.com.cn/thread-1118496-1-1.html

MicroPython Hands-on (16) - Image display of the control board
https://bbs.eeworld.com.cn/thread-1118945-1-1.html

MicroPython Hands-on (17) - Touch pin of control board
https://bbs.eeworld.com.cn/thread-1119462-1-1.html

MicroPython Hands-on (18) - Sound and light sensor of the control board
https://bbs.eeworld.com.cn/thread-1119583-1-1.html

MicroPython Hands-on (19) - Buzzer and music on the control board
https://bbs.eeworld.com.cn/thread-1119668-1-1.html

MicroPython Hands-on (20) - Three-axis acceleration of the control board
https://bbs.eeworld.com.cn/thread-1119998-1-1.html

MicroPython Hands-on (21) - Magnetic Field Sensor of Control Board
https://bbs.eeworld.com.cn/thread-1120188-1-1.html

MicroPython Hands-on (22) - Wireless Broadcasting of Control Board
https://bbs.eeworld.com.cn/thread-1120835-1-1.html

MicroPython Hands-on (23) - WiFi and Bluetooth of the control board
https://bbs.eeworld.com.cn/thread-1120934-1-1.html

MicroPython Hands-on (24) - Extension of the control board and control treasure
https://bbs.eeworld.com.cn/thread-1121208-1-1.html

MicroPython Hands-on (25) - Speech Synthesis and Speech Recognition
https://bbs.eeworld.com.cn/thread-1123752-1-1.html

Supplementary content (2020-6-2 15:50): MicroPython hands-on (26) - OneNET of the Internet of Things https://bbs.eeworld.com.cn/thread-1125172-1-1.html MicroPython hands-on (27) - WeChat applet of the Internet of Things https://bbs.eeworld.com.cn/thread-1125520-1-1.html
 
 
 

12
Return list
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list