Example: Simple Camera

The “Hello World” of APRON examples is the simple act of grabbing an image from a webcam and displaying it in the simulator. The script below uses the apron.webcam plugin. First the camera is initialised to capture images at a specific width and height. The program then loops repeatedly grabbing an image, and then displaying it.


!define(CAM_W, 128)
!define(CAM_H, 128)

!create('camera', REGISTER, CAM_W, CAM_H)

webcam.init(CAMW, CAM_H)

    r[camera] = webcam.getLuminance(0)
    r[camera] = r[camera] / 2
This entry was posted in Examples. Bookmark the permalink.

Leave a Reply