Color detection tolerance range
![userHead](https://dfimg.dfrobot.com/dfPortrait2.png)
Is there a possibility to set something like a tolerance range when detecting colors? We are trying to detect colored obstacles on a car racing course and, as there are hand-painted wooden blocks, they have slight variations in color.
I agree with Jenna. Huskylense is the perfect choice for this project. However, if you consider a GUI Design for Multi Color Detection in MATLAB, you can follow this tutorial:
https://www.theengineeringprojects.com/2017/06/multi-color-detection-in-matlab.html
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)
When recognizing color blocks of similar colors, the recognition accuracy can be adjusted by setting the threshold. For example, in the figure above, some yellow balloons with similar colors are not recognized, and the threshold may be set higher. In the parameter setting of the color recognition function, there is the "Block Sized Threshold" parameter. The lower the value of this parameter, the lower the accuracy, but the more similar color blocks can be recognized. As shown in the figure below, when the threshold is 20, only one yellow ball can be recognized, and when the threshold is 0, all three yellow balls can be recognized. Please adjust the threshold according to the actual effect, so that the recognition accuracy is within your acceptable range.With this function, you can easily obtain the number of yellow balls on the screen in real time.
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)
You can directly let HUSKYLENS learn colored obstacles on a car racing course.
Color recognition is greatly affected by ambient light. Sometimes HuskyLens may misidentify similar colors. Please try to keep the ambient light unchanged.
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)