SunFounder PiCar-X Kit
Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook!
Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
Why Join?
• Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
• Learn & Share: Exchange tips and tutorials to enhance your skills.
• Exclusive Previews: Get early access to new product announcements and sneak peeks.
• Special Discounts: Enjoy exclusive discounts on our newest products.
• Festive Promotions and Giveaways: Take part in giveaways and holiday promotions.
Ready to explore and create with us? Click [] and join today!
6.8 Color Detection
PiCar-X is a self-driving car with a built-in camera, which allows Ezblock programs to utilize object detection and
color recognition code. In this section, Ezblock will be used to create a program for color detection.
Note: Before attempting this section, make sure that the Raspberry Pi Camera’s FFC cable is properly and securely
connected. For detailed instructions on securely connecting the FCC cable, please reference: Assembly Instructions.
In this program, Ezblock will first be told the Hue-Saturation-Value (HSV) space range of the color to be detected, then
utilize OpenCV to process the colors in the HSV range to remove the background noise, and finally, box the matching
color.
Ezblock includes 6 color models for PiCar-X, “red”, “orange”, “yellow”, “green”, “blue”, and “purple”. Color cards
have been prepared in the following PDF, and will need to be printed on a color printer.
• [PDF]Color Cards
6.8. Color Detection 125