Camera

Capture image using either front or back camera

  • Library:
  • Simulink Support Package for Apple iOS Devices / Audio & Video

Description

The Camera block captures image from the front or back camera of the device. The Camera block outputs red (R), green (G), and blue (B) component values of an image captured by the device camera. The R, G, B ports each return a matrix of uint8 values.

Note

During simulation with no hardware connected, this block does nothing. For more information, see Block Produces Zeros or Does Nothing in Simulation (Simulink).

Ports

Output

expand all

Red component of an image, returned as a numeric matrix. This matrix is of same size as outputs G and B.

Data Types: uint8

Green component of an image, returned as a numeric matrix. This matrix is of same size as outputs R and B.

Data Types: uint8

Blue component of an image, returned as a matrix. This matrix is of same size as outputs R and G.

Data Types: uint8

Parameters

expand all

Select the target hardware. The target hardware has to match the value of the hardware board set in the hardware implementation pane of the Configuration Parameters dialog box. To open the configuration parameters dialog box, on Modeling tab, click Model Settings.

Select one of the two cameras available in the device.

  • Front — Use the camera on the same side as the display.

  • Back — Use the camera on the opposite side from the display.

Select the size of output image.

Image size significantly affects the rate at which the camera produces data. For example, capturing images at 1920-by-1080 produces almost six times more data than capturing images at 720-by-486.

Note

After the model is deployed on the device, you cannot change the value of this parameter.

Specify how often the block reads the camera sensor and outputs the data. Units are in seconds.

Note

Smaller values for Sample time require the processor to complete the same number of instructions in less time, which can cause task overruns.

Introduced in R2015a