The Camera is a template class, that you can use in your own Java-project. Currently, the code is only tested with a Raspberry-Camera and the crowpi-image. You can take pictures or videos, with or without a preview.

To connect the camera, use this video. The video is mentioned on the official website. The camera class is using the bash-commands “libcamera-hello”, “libcamera-still” and “libcamera-vid”. To use them, set up the raspberry with the following Introduction



An example on how to use the Camera-Class from the Hardware-Catalog

System.out.println("Initializing the camera");
Camera camera = new Camera();

System.out.println("Taking a default picture");

System.out.println("Taking a pic with different parameters");
var config = Camera.PicConfig.Builder.outputPath("/home/pi/Pictures/")


System.out.println("waiting for camera to take pic");

System.out.println("Taking a video for 3 seconds");
var vidconfig = Camera.VidConfig.Builder.outputPath("/home/pi/Videos/")

Further application

The class is implemented in the sample project Photobooth.

Further project ideas

  • Use a camera and a motion-sensor to create a wildlife-camera
  • Use a camera to monitor the entrance of a building, by publishing the preview of the camera to a webserver