MATLAB Answers

Imread error in Raspberry pi deployment

2 views (last 30 days)
Hello everyone!
I wrote small function, including imread(), and tried to deploy in Raspberry PI. But I got this error “The function imread uses a precompiled shared library which is not supported on the chosen target.”
Does it mean I cannot use imread() in Raspberry PI? Shall I need to use fread() or fopen() to read the image files in Raspberry system?

Accepted Answer

Walter Roberson
Walter Roberson on 4 Aug 2021
Edited: Walter Roberson on 4 Aug 2021
Two cases:
If the file is a static file available to the matlab host, with constant name, then read the image and save it to a mat. Then in the code to be deployed, coder.load()
If the file is not a static file with fixed name, such as if it is a file from the raspberry file system (especially one with dynamic name) then use coder.ceval() to make a call to an external library routine to do the reading work, such invoking libjpeg
  3 Comments
Hyoung-Bum Kim
Hyoung-Bum Kim on 5 Aug 2021
Thanks a lot!
I will choose your advice of using the libjpeg library.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!