Main Content

Use BeagleBone Black Web Camera to Capture Images

This example shows how to create a connection to the web camera and capture still images.

  1. Create a connection to the BeagleBone® Black hardware.

    bbb = beaglebone
  2. Create a connection to the web camera and assign the connection to an object, wcam. webcam with only one argument connects to the first camera attached to BeagleBone Black.

    wcam = beaglebone.webcam(bbb)
    wcam = 
    
      webcam with properties:
    
                        Name: '/dev/video0'
                  Resolution: '320x240'
        AvailableResolutions: {'320x240'  '640x480'}
  3. Import and display a sequence of ten images on your host computer.

    for ii = 1:10
    img = snapshot(wcam)
        imagesc(img)
        drawnow
    end