Acquiring images with the webcam
In this first recipe, we will prepare the dataset by acquiring images of cans using the USB webcam and labeling them using Edge Impulse.
Getting ready
As with all ML projects, our first step is dataset preparation. In this project, the dataset will be created from scratch using Edge Impulse.
The data acquisition for images does not differ from what we experienced in Chapter 4, Using Edge Impulse and Arduino Nano to Control LEDs with Voice Commands, for building the KWS dataset.
To prevent overfitting and improve model robustness, you should create a more diverse training dataset. For example, you might consider the following to ensure that the model is reliable and effective in real-world scenarios:
- Different backgrounds
- Different distances from the camera
- Different angles
- Different light conditions
We recommend using a USB webcam rather than the laptop’s built-in one because capturing...