ImageMagick through command line

1 回表示 (過去 30 日間)
Corey Atwell
Corey Atwell 2017 年 10 月 19 日
編集済み: Jan 2017 年 10 月 19 日
Basically I wanna use the tools available through ImageMagick, however, when running command prompts in Matlab it does not recognize the ImageMagick tools.
For instance: convert image.png -dither FloydSteinberg -remap ColorMap.png remap remap_image.png would normally work, except when run through matlab it says the command "convert" is not found. I believe this is because it is not part of the system's path. I just want a workaround.
Thanks
  1 件のコメント
Julian Hapke
Julian Hapke 2017 年 10 月 19 日
編集済み: Julian Hapke 2017 年 10 月 19 日
You could just pass the absolute path to your executable into the system command
Edit: you could also try this (which is for Linux, but should also work on Windows with the system command)
https://de.mathworks.com/matlabcentral/answers/27762-executing-unix-commands-set-in-path-in-matlab-does-not-work-with-unix-command

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

回答 (1 件)

Jan
Jan 2017 年 10 月 19 日
編集済み: Jan 2017 年 10 月 19 日
You did not post the code you use, but
!convert image.png -dither FloydSteinberg -remap ColorMap.png remap remap_image.png
or
system(['convert image.png -dither FloydSteinberg -remap ', ...
'ColorMap.png remap remap_image.png')
is expected to work. If this is failing, use the full path to the executable.

カテゴリ

Help Center および File ExchangeApp Building についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by