imwrite function in c++ shared library

조회 수: 4 (최근 30일)
Aksay Fatih Öncel
Aksay Fatih Öncel 2018년 8월 17일
댓글: David 2022년 4월 16일
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일
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일
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개)

카테고리

Help CenterFile Exchange에서 Image Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by