Imread error in Raspberry pi deployment

6 Ansichten (letzte 30 Tage)
Hyoung-Bum Kim
Hyoung-Bum Kim am 4 Aug. 2021
Verschoben: Walter Roberson am 20 Aug. 2023
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?
  3 Kommentare
Walter Roberson
Walter Roberson am 19 Aug. 2023
Could you confirm that you are using Raspberry Pi with a SenseHat board? https://www.mathworks.com/help/supportpkg/raspberrypiio/sense-hat.html
Joseph Neelen
Joseph Neelen am 20 Aug. 2023
Verschoben: Walter Roberson am 20 Aug. 2023
I use Pi3B with sensehat. Its working perfect. Using MATLAB all sensehat functions are oké. Except the 8x8 LED matrix. WritePixel, wrieMessage show no result without errond massages.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 4 Aug. 2021
Bearbeitet: Walter Roberson am 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
  6 Kommentare
Walter Roberson
Walter Roberson am 2 Apr. 2022
Is there a reason you cannot preprocess the files to become just arrays of pixel data, or at most arrays of pixel data with a size header?
Haitham Kanj
Haitham Kanj am 4 Apr. 2022
@Walter Roberson, my code finally worked. I ended up using stb_image library to read the image and store the data as arrays of pixel data. What worked for me was declaring a global variable that both the c-files and matlab files can see during code generation, and the c-files where responsible for loading the global variable (3D array) with pixel data which then matlab can use.
I really had a hard time figuring things out. There are a lot of details that need to be considered before attempting to substitute imread with c-files and if you miss one of them, nothing will work.
Thank you @Walter Roberson, you gave me a starting point when you said use coder.ceval() to call external librariries. For those who have similar trouble using imread with codegen for raspberry pi, i can help you out haitham.kanj@lau.edu

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB Support Package for Raspberry Pi Hardware finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by