Detect Color with a Webcam
In this guide you will detect the color red using your computer’s webcam and the Viam vision service. Without writing any code, you will be able to view your camera stream, with detection bounding boxes, from the Viam app control interface.
You will learn
- How to configure a webcam
- How to use the color detection vision service
Requirements
You don’t need to buy or own any hardware to complete this tutorial. If you have the following components, you can follow along on your own hardware:
- A Linux, macOS or WSL computer that can run
viam-server
. - A webcam: this could be the webcam on your laptop or any other webcam you can connect to your computer.
Instructions
Follow these instructions to configure your machine and test detecting colors:
Next steps
You can now detect colors on a camera stream. Of course these detections are not just accessible from the Viam app, but you can also use the vision service API.
You can also use the vision service with Machine Learning models:
To learn about coding with Viam’s SDKs, try making a rover move in a square.
Have questions, or want to meet other people working on robots? Join our Community Discord.
If you notice any issues with the documentation, feel free to file an issue or edit this file.
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!