Display image on a raspberry pi
13 views (last 30 days)
Show older comments
Hello
I'm trying to use the 'displayimage' function seen here: https://www.mathworks.com/help/supportpkg/raspberrypiio/ref/displayimage.html
I'm simply trying to display a .png image on a monitor connected to my raspberry pi. I have installed MATLAB Support Package for the Raspberry Pi as well as MATLAB coder. I am able to communicate with my pi, and my script runs just fine on MATLAB. The image pops up on in a MATLAB window but nothing shows up on the monitor attached to my pi. Here's my code:
function ImageDisplayTest()%#codegen directive
% Create a Raspberry Pi object
r=raspi();
img = imread('image.png');
displayImage(r,img);
end
What am I doing wrong? Am I misunderstanding the function of 'displayImage'?
Thank you!
3 Comments
Prasanth Sunkara
on 29 Jan 2020
Hello Karen,
Thanks for the clarification.
There are a couple of observations from my side.
1) imread is not codegen supported.
2) Trying to display an image stored from your host pc on pi is not supported. That is why you are seeing those errors.
3) However if the image is orginated from your pi through webcam or cameraboard, it possible to display that live image using "displayImage". I see that currently you do not have any image acquisition devices.
If you could share more details on the motivation to display a static image from PC on Pi, probably we could explore some other options.
-Prasanth
Answers (0)
See Also
Categories
Find more on MATLAB Support Package for Raspberry Pi Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!