# Color detection

**URL:** <https://forum.hello-robot.com/t/color-detection/554>\
**Category:** Ask\
**Created:** [December 22, 2022, 5:46pm UTC](https://forum.hello-robot.com/t/color-detection/554 "2022-12-22T17:46:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonny](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@sonny](https://forum.hello-robot.com/u/sonny)\
**Post date:** [December 22, 2022, 5:46pm UTC](https://forum.hello-robot.com/t/color-detection/554/1 "2022-12-22T17:46:14Z")

</div>

Has anyone tried to see if the robot can detect colors?

---

<div class="post-metadata">

**Author:** ![bshah](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.hello-robot.com/bshah/32/55_2.png) [@bshah](https://forum.hello-robot.com/u/bshah)\
**Post date:** [December 22, 2022, 6:30pm UTC](https://forum.hello-robot.com/t/color-detection/554/2 "2022-12-22T18:30:56Z")

</div>

Hi @sonny, I recommend using OpenCV to detect colors in the RGB imagery from the Realsense camera in Stretch’s head. A common first step is to use the Python `cv2.inRange` method to mask a color range from a HSV image. Take a look at this [Stackoverflow answer](https://stackoverflow.com/a/10951189) for code.
