JETANK AI Kit-Color Recognition

From Waveshare Wiki
Jump to: navigation, search

Color Recognition

This tutorial will identify the different colors by getting the HSV value of a block of pixels in the screen by the camera.

  • Type in the address bar of your browser http://<jetbot_ip_address>:8888, connect to the cart and open / Notebooks/JETANK_4_ColorRecognition/ on the left side. Open the file JETANK_4_ColorRecognition_en.ipynb. The program provides Chinese and English versions, where the CN suffix is a Chinese comment and EN is an English comment.
  • Again, the program first initializes the camera and creates a widget to display the camera screen.

JETANK AI Kit Manual 16.png JETANK AI Kit Manual 17.png

  • The above program is a color recognition program, the main operation of the program is to convert RGB colors to HSV color space. Only after the color is converted to HSV can the different colors be distinguished by HSV pixel values.

JETANK AI Kit Manual 18.png

  • When you run the above program to start the color setting, the image screen will display the HSV value of the color of the object in the small white square. Different colors will be displayed with different HSV values.

JETANK AI Kit Manual 19.gif

  • The program finally closes the image processing function and turns off the camera.

JETANK AI Kit-Motion Detection02.png