element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Eye On Intelligence Challenge
  • Challenges & Projects
  • Design Challenges
  • Eye On Intelligence Challenge
  • More
  • Cancel
Eye On Intelligence Challenge
Blog Z7_Color_AID: Color Detection Final Summary and Future Work
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Eye On Intelligence Challenge to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: flyingbean
  • Date Created: 18 Nov 2024 8:23 PM Date Created
  • Views 489 views
  • Likes 6 likes
  • Comments 5 comments
  • video processing
  • arty z7
  • zynq
  • jupyter
  • fpga
  • Eye on Intelligence Challenge
  • pynq
Related
Recommended

Z7_Color_AID: Color Detection Final Summary and Future Work

flyingbean
flyingbean
18 Nov 2024

Table of Contents

  • Color Detection and Contour Drawing Flowchart
  • Colormap for HSV
  • Z7_Color_AID Phase 1 Project Demonstration
  • Future Work of Z7_Color_AID Project
  • References

Color Detection and Contour Drawing Flowchart

As my previous blog mentioned OpenCV is a great framework for image processing projects. The final presentation for this design challenge is Z7_Color_AID phase 1 project, which is color recognition via OpenCV/PYNQ platform. The overall signal flowchart is as follows.

image

Current project can recognize multiple colors in the real time on Arty-Z7-20 platform under PYNQ_V3.0.1 without any FPGA HW acceleration.

Colormap for HSV

HSV stands for Hue Saturation Value.  The HSV color model is more intuitive to human vision. RGB color model is preferred by display hardware.  Therefore, RGB color value from WebCAM is transferred into HSV color value for the targeted color detection. I found that using HSV colormap is a simple and efficient way to bring the project up into running this week. Here is the HSV colormap (Ref[1]) I used for the project.

image

I found a piece of color patterned paper at my crafting corner, which could be a good subject for Z7_Color_AID platform to run color detection.

image

I visualized to select the upper/lower bound of each color space from the HSV colormap as below. I used unsigned int 8 data type for Zynq FPGA.  The selected color list is red, green, blue, yellow, orange, and light (light blue).

image

Z7_Color_AID Phase 1 Project Demonstration

It is the showtime of Z7_Color_AID phase 1 project after previous discussion of the background information.

image

The initial testing result is not bad at all from above photo since the major defined colors are detected as expected.

Here is the short video of color detection in the real time on Arty-Z7-20 platform.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

The Jupyter Notebook code for the presentation is below.

image

image

image

image

Finally close video/HDMI port as below.

image

Summary of the phase 1 project:

  1. OpenCV/PYNQ framework is very handy for computer vision applications. Arty-Z7-20 FPGA has a decent performance for general color detection/contour drawing tasks.
  2. The initial bench testing result laid a solid foundation for my further work on the same platform

Future Work of Z7_Color_AID Project

  1. Zynq HW acceleration on Arty-Z7-20 platform

PYNQ_v3.0.1 will need to work with AMD/Xilinx Vitis Accelerated libraries, Vitis Vision libraries, and related dependencies. I am digging related training materials of them now. The gap between PYNQ_v3.0.1 prebuilt image and AMD/Xilinx libraries I mentioned could be very big.

  1. ML algorithm selection and training machine selection

I am new for ML projects. I did learn a lot from the community here. I tried to use a general PC under Ubuntu 20.04 to run BNN training algorithm last month. It took the PC 130 hours for 500 epochs of BNN training and the error rate was still 20%. I am planning to acquire a GPU card for ML projects now. Hopefully, a GPU card can save me tons of time for ML projects.

  1. Deploy ML on Arty-Z7-20 platform

Deploy ML on Arty-Z7-20 platform can be very challenging due to smaller size of FPGA and less support for ML applications from AMD/Xilinx. However, due to cheaper price of the part and less power consumption, Zynq FPGA can be a good candidate for many less computing ML applications.

References

[1] HSV color map:  https://stackoverflow.com/questions/10948589/choosing-the-correct-upper-and-lower-hsv-boundaries-for-color-detection-withcv 

Previous Blogs:

Z7_Color_AID-Blog#01:First Impression of PYNQ on Arty-Z7-20

Z7_Color_AID Blog #2: Reproduce PYNQ Image on Ubuntu 20.04

Z7_Color_AID Blog #3: PYNQ Framework: Library and Overlay

Z7_Color_AID Blog #4: Architecture Discussion of Z7_Color_AID

Z7_Color_AID Blog #5: OpenCV on Zynq FPGA

 

  • Sign in to reply
  • DAB
    DAB 7 months ago

    Good finish to your project.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • flyingbean
    flyingbean 7 months ago in reply to rsc

    Great opions. Will add the ideas for my next phase of the project.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • rsc
    rsc 7 months ago

    Nice project.  You could market it to paint stores that need to match colors from customer samples.  It could also be used for detecting bad spots on grocery items like fruits or vegetables.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • flyingbean
    flyingbean 7 months ago

    Hi javagoza: I learned a lot from my own project, your project and others. I really appreciate Element14 and AMD/Xilinx sponsored the challenge. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • javagoza
    javagoza 7 months ago

    Congratulations flyingbean on creating such an impressive color aid system! Your video demonstration was fantastic. As someone who is colorblind, I truly appreciate your color recognition help system. I've often thought about how useful something like this would be. Dealing with resistor color codes has always been a challenge for me.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube