Capture image using either front or back camera
Simulink Support Package for Apple iOS Devices / Audio & Video
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
During simulation with no hardware connected, this block does nothing. For more information, see Block Produces Zeros or Does Nothing in Simulation (Simulink).
R— Red component of image
Red component of an image, returned as a numeric matrix. This matrix is of same size as outputs G and B.
G— Green component of image
Green component of an image, returned as a numeric matrix. This matrix is of same size as outputs R and B.
B— Blue component of image
Blue component of an image, returned as a matrix. This matrix is of same size as outputs R and G.
iPhone 5(default) |
iPhone 6 Plus|
iPhone 6s Plus|
iPhone 7 Plus|
iPod touch (5th generation)|
iPod touch (6th generation)|
iPad Mini 4|
iPad Mini 3|
iPad Mini 2|
iPad Air 2|
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.
Camera location— Select camera of device
Select one of the two cameras available in the device.
Front — Use the camera on the same side as the
Back — Use the camera on the opposite side from the
Image size— Select the size of the output image
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.
After the model is deployed on the device, you cannot change the value of this parameter.
Sample time— Sample time
0.1(default) | nonnegative scalar
Specify how often the block reads the camera sensor and outputs the data. Units are in seconds.
Smaller values for Sample time require the processor to complete the same number of instructions in less time, which can cause task overruns.