Greetings,
I am compiling a matlab code which has the imwrite function in it. I want it to create an image file and write it to the disk when the c++ code calls my dll. The problem is it does not output the image file. Is it not possible to use imwrite function in a c++ shared library? If it is so, are there any alternatives to this function that will create an image file in a predefined path the user provides?

6 件のコメント

Kojiro Saito
Kojiro Saito 2018 年 8 月 17 日
Do you use MATLAB Coder or Compiler SDK for creating a dll?
Aksay Fatih Öncel
Aksay Fatih Öncel 2018 年 8 月 17 日
Compiler SDK.
Kojiro Saito
Kojiro Saito 2018 年 8 月 17 日
imwrite is supported in Compiler SDK. What is your code for calling your dll?
Aksay Fatih Öncel
Aksay Fatih Öncel 2018 年 8 月 17 日
Do you mean the C++ code?
Kojiro Saito
Kojiro Saito 2018 年 8 月 17 日
Yes, and MATLAB function, if possible. Don't you get any error?
Walter Roberson
Walter Roberson 2018 年 8 月 17 日
Note here the difference between MATLAB Compiler SDK and MATLAB Coder.
MATLAB Coder would be for stand-alone code generation; imwrite() is not supported for that purpose.
MATLAB Compiler SDK would be for generating a DLL that called into the MATLAB Engine to do the work, requiring that MCR be present. imwrite is supported for that purpose.
I interpreted your "compile" as meaning code generation, but Kojiro Saito is correct that you could easily have meant Compiler SDK.

サインインしてコメントする。

 採用された回答

Walter Roberson
Walter Roberson 2018 年 8 月 17 日

1 投票

imwrite() is not supported for code generation, for any file type.
(and imread() supports code generation only for reading 8 bit JPEG.)
You can find external libraries to write files, such as libjpeg and libtiff and libpng

2 件のコメント

Aksay Fatih Öncel
Aksay Fatih Öncel 2018 年 8 月 17 日
Thank you, that was very prompt.
David
David 2022 年 4 月 16 日
Can someone point us to an example?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で MATLAB Compiler SDK についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by