Welcome to WiFi Camera Module repository
4. Color recognition
Color recognition
- First determine whether the version of the image transmission module is the AI version firmware. If you already know the firmware version, you can ignore this step and use the wifi_ver command to query, as shown in the figure below

- Switch the mode to the color recognition mode. Use the following command to send ai_mode:3 through the serial assistant. After successful configuration, the module will restart and print the current firmware version. You can start color recognition, as shown in the figure

Note: If the current mode is already the color recognition mode, the module only returns ok

- To start recording the color, you need to send KEY_MENU through the serial assistant and wait for the recording box to appear on the screen
Warm Tips: You can send KEY_UPUP** through the serial port to increase the recording box selection, and send KEY_DOWN to reduce the box selection**
KEY_UPUP:

KEY_DOWN:

- After selecting the color, send KEY_PLAY through the serial assistant. After confirming the selected color, the recording box on the screen will disappear, and then the color just recorded will be directly recognized. And send the coordinates of the upper left corner and lower right corner of the first recognized box through the serial port. The specific content is $upper left corner x-axis coordinate, upper left corner y-axis coordinate, lower right corner x-axis coordinate, lower right corner y-axis coordinate, # Note: You need to open the screen to start recognition. If the screen is closed in the middle, the recognition will also be closed.
Result:

Serial port information:

- When you want to add recognized colors, you can repeat steps 3 and 4. When you want to delete recognized colors (starting from the last color), the mode is in the detection state and then send KEY_PLAY from the serial assistant to delete it.
