Collecting image data with the OpenMV Cam H7 Plus
To set up your OpenMV camera, and collect some data:
- 3.Connect a micro-USB cable to the camera, and open the OpenMV IDE. The camera should automatically update to the latest firmware.
- 4.Verify that the camera can capture live images, by clicking on the Connect button in the bottom left corner, then pressing Play to run the application.
Set up your OpenMV camera. Press the 'Connect' button, then press 'Play' to run the application.
A live feed from your camera will be displayed in the top right corner of the IDE.
Once your camera is up and running, it's time to start capturing some images and build our dataset.
First, set up a new dataset via Tools -> Dataset Editor, select New Dataset.
Creating a new dataset in the OpenMV IDE
This opens the 'Dataset editor' panel on the left side, and the 'dataset capture script' in the main panel of the IDE. Here, create three classes: "plant", "lamp" and "unknown". It's important to add an unknown class that contains random images which are neither lamps nor plants.
Create three classes in the OpenMV IDE by clicking the 'New class folder' (highlighted in yellow).
As we'll build a model that takes in square images, change the 'Dataset capture script' to read:
import sensor, image, time
sensor.set_pixformat(sensor.RGB565) # Modify as you like.
sensor.set_framesize(sensor.QVGA) # Modify as you like.
sensor.set_windowing((240, 240)) # Modify as you like.
sensor.skip_frames(time = 2000)
clock = time.clock()
img = sensor.snapshot()
Now you can capture data for the three classes.
- 1.Click the Play icon to run the 'dataset capture script' on your OpenMV camera.
- 2.Select one of the classes by clicking on the folder name in the 'Dataset editor'.
- 3.Take a snap by clicking the Capture data (camera icon) button.
Do this until you have captured 30 images per class from a variety of angles. Also make sure to vary the things you capture for the unknown class.
Capturing data (a plant image shown on the left) into a dataset using the OpenMV camera
To import the dataset into Edge Impulse go to Tools > Dataset Editor > Export > Upload to Edge Impulse project.
Synchronize your dataset with Edge Impulse straight from the OpenMV IDE
Then, choose the project name, and the split between training and testing data (recommended to keep this to 80/20).
Choose a project, and then the dataset split to upload your data
A duplicate check runs when you upload new data, so you can upload your dataset multiple times (for example, when you've added new files) without adding the same data twice.
Our dataset now appears under the Data acquisition section of our project.