Main Content

stop

Stop recording from camera board or selected camera on ArduCam Multi Camera Adapter Module

Add-On Required: This feature requires the MATLAB Support Package for Raspberry Pi Hardware add-on.

Description

stop(mycamera) stops recording video from the Camera Board.

stop(aCamObj) stops recording the video from the selected camera on ArduCam Multi Camera Adapter Module.

Examples

collapse all

Create a connection from the MATLAB® to the Raspberry Pi® board. If you encounter errors after running the above command, try using additional arguments (as listed in raspi) or refer to Troubleshoot Connecting Issues to Raspberry Pi Hardware.

mypi = raspi;

Create a connection, mycam, from the MATLAB software to the camera board on the Raspberry Pi hardware, and set the image resolution. The connection displays the camera board properties.

mycam = cameraboard(mypi,"Resolution","1280x720")
mycam = 

Cameraboard with Properties:

                    Name: Camera Board   
              Resolution: "1280x720"      (View available resolutions)
                 Quality: 10              (1 to 100)
                Rotation: 0               (0 or 180)
          HorizontalFlip: 0              
            VerticalFlip: 0              
               FrameRate: 30              (2 to 90)
               Recording: 0              

   Picture Settings
              Brightness: 50              (0 to 100)
                Contrast: 0               (-100 to 100)
              Saturation: 0               (-100 to 100)
               Sharpness: 0               (-100 to 100)

   Exposure and AWB
            ExposureMode: "normal"        (View available exposure modes)
    ExposureCompensation: 0               (-10 to 10)
                 AWBMode: "indoor"        (View available AWB modes)
            MeteringMode: "average"       (View available metering modes)

   Effects
                     ROI: [0.00 0.00 1.00 1.00] (0.0 to 1.0 [top, left, width, height])

Capture and display a sequence of 10 snapshots on your computer.

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

Each of the 10 snapshots is the latest image captured by the camera.

If the image is upside down, change its orientation.

mycam.Rotation = 180

You can use the same approach to change the values of other cameraboard properties.

Record a 60 second video.

record(mycam,"myvideo.h264",60)

Stop the recording immediately.

stop(mycam)

Copy the video from the board to your computer.

getFile(mypi,"myvideo.h264","C:\MATLAB")

Delete the video file from the hardware to free up space.

deleteFile(mypi,"myvideo.h264")

Create a connection from the MATLAB to the Raspberry Pi board. If you encounter errors after running the above command, try using additional arguments (as listed in raspi) or refer to Troubleshoot Connecting Issues to Raspberry Pi Hardware.

mypi = raspi;

Create a connection from MATLAB to the ArduCam module attached to the Raspberry Pi board. Set the image resolution. The connection displays the ArduCam properties.

aCamObj = arducam(mypi,"MultiCamAdapter","Resolution","1280x720")
selectCamera("Camera B");
aCamObj = 

ArduCam with Properties:

              ModuleName: "Multi Camera Adapter"  
          SelectedCamera: "Camera B" 
              Resolution: "1280x720"       (View available resolutions)
               Recording: 0              

Record a 10-second video.

record(aCamObj,"myvideocamB.h264",10);

Stop the recording.

stop(aCamObj);

Input Arguments

collapse all

Connection to camera board on the Raspberry Pi hardware, specified as a cameraboard object.

Example: mycam

Connection to a camera on ArduCam Multi Camera Adapter Module, specified as an arducam object.

Use the arducam to create this connection.

Example: myarducam

Extended Capabilities