Transfer file from Raspberry Pi hardware to host computer
You can copy a file, such as .profile, from the Raspberry Pi hardware to the MATLAB Current Folder on your host computer.
You can use a wildcard to copy any matching file or files from the Raspberry Pi hardware to your host computer. You can specify the path of a destination folder. The folder must already exist.
You can create a connection to the Camera Board, take a photograph, and record video.
Create a connection to the Raspberry Pi board.
mypi = raspi;
Create a connection to the Camera Board while changing the resolution, and assign that connection to a handle, mycam. The handle 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, 90, 180 or 270) HorizontalFlip: 0 VerticalFlip: 0 FrameRate: 30 (2 to 30) 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: 'auto' (View available exposure modes) ExposureCompensation: 0 (-10 to 10) AWBMode: 'auto' (View available AWB modes) MeteringMode: 'average' (View available metering modes) Effects ImageEffect: 'none' (View available image effects) VideoStabilization: 'off' ROI: [0.00 0.00 1.00 1.00] (0.0 to 1.0 [top, left, width, height])
Import and display a sequence of ten snapshots on your host computer.
for ii = 1:10 img = snapshot(mycam); imagesc(img); drawnow; end
If the image is upside down, change the orientation of the image.
mycam.Rotation = 180;
You can use the same approach to change the values of many mycamera properties listed in the "Name-Value Pair Arguments" for cameraboard.
Record a 60 second video.
Stop recording before the 60 seconds have elapsed.
Copy the video from the board to your host computer.
Delete the video file from the board to free up space.
Connection to a specific board, specified as a handle.
Use raspi to create this connection.
Path and file name on the Raspberry Pi hardware, specified as a string. You can use either the absolute path from the root folder, the relative path from the present working folder. Use Linux® path and file naming conventions. The default path is /home/pi/.
Data Types: char
Path and name of file on host computer, specified as a string. If not specified, getFile uses the MATLAB Current Folder and the current file name. Use naming conventions of the operating system on the host computer. This function does not create new folders. Folder names in the path must already exist. Optional.
Data Types: char