Main Content

displayImage

Display an image on theRaspberry Pihardware or on the LED Matrix of SenseHAT

Description

example

For Raspberry Pi:displayImage (mypi,img) %Raspberry Pidisplays the specified image on theRaspberry Pi™hardware. During simulation, this function displays the image on the computer.

example

For Raspberry Pi:displayImage (mypi,img,Name,Value) %Raspberry Pidisplays the specified image with a window title on theRaspberry Pihardware. During simulation, this function displays the image on the computer.

example

For SenseHAT:displayImage (mysh,img) %SenseHATdisplays an image of 8 * 8 * 3 dimension on the LED Matrix ofSenseHAT.

example

For SenseHAT:displayImage (mysh,img,orientation) %SenseHATdisplays an image of 8 * 8 * 3 dimension on the LED Matrix ofSenseHATwith the specified orientation. The supported values for orientation are: 0, 90, 180, and 270 degrees.

The following image shows the orientations of the LED Matrix.

Examples

collapse all

Display image on the Raspberry Pi hardware

img=imread('edge_detection.png'); displayImage(mypi,img);

显示一个图像放大e on the hardware.

Display image with the specified title on the image window of the Raspberry Pi hardware

img=imread('edge_detection.png'); displayImage(mypi,img,'Title','Edge Detection');

显示一个图像放大e with the title,Edge Detection, on the image window of the hardware.

Display image on the LED Matrix

img=imread('senseHAT_demo.png'); displayImage(mysh,img);

显示一个图像放大e of 8 * 8 * 3 dimension on the LED Matrix.

Display image with orientation

img = imread('senseHAT_demo.png'); displayImage(mysh,img,90);

显示一个图像放大e of 8 * 8 * 3 dimension on the LED Matrix with the specified orientation of 90 degrees.

Input Arguments

collapse all

Connection to a specific Raspberry Pi hardware board, specified as araspiobject.

Connection to a SenseHAT board, specified as a sensehat object.

显示在LED矩阵的图像对象8 x 8 x 3 dimension or on the Raspberry Pi hardware.

The orientation to be applied for an image to be displayed. The supported values of orientation are 0, 90, 180, and 270.

Name-Value Arguments

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, whereNameis the argument name andValueis the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and encloseNamein quotes.

Example:displayImage(mypi,inputImage,'Title','Webcam Output')

Title of the image window displayed on the Raspberry Pi hardware, specified as the comma-separated pair consisting of'Title'and the title of the image window.

Example:displayImage(mypi,img,'Title','Edge Detection');

Data Types:string

Extended Capabilities

Version History

Introduced in R2016b