Picamera2 Example

Examples of using Picamera2 for image classification, object detection, object segmentation, and pose estimation.

References

Official website of Raspberry Pi AI Camera

https://www.raspberrypi.com/documentation/accessories/ai-camera.html

Preliminary preparation

Download the official source code

If you cannot download, you can find the file in the software data folder.

image-20241214171237483

Install OpenCV dependencies

image-20241214170430252

Picamera2 example

All cases require the neural network model to be loaded successfully before the screen is displayed, otherwise the preview screen is a black interface!

image-20241214171835096

Object detection

image-20241214172933567

Use Ctrl+c shortcut key to close the program in the terminal.

Pose estimation

image-20241214172759074

Use the Ctrl+c shortcut key in the terminal to close the program.

Object segmentation

image-20241214173211412

Use the Ctrl+c shortcut key in the terminal to close the program.

Image classification

image-20241214173530406

Use Ctrl+c shortcut key to close the program in the terminal.