从Matlab调用ImageMagick时出错 [英] Error in calling ImageMagick from Matlab

查看:120
本文介绍了从Matlab调用ImageMagick时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在系统(Windows)中安装了ImageMagick,其命令位于系统PATH中.通过命令行绝对可以正常工作 我想使用系统命令从Matlab调用ImageMagick的转换"功能. "C:\ Users \ Vivek"是图像的路径.我必须通过Matlab测试ImageMagick的工作,因为我需要进一步处理(使输入适合Tesseract OCR)

I have installed ImageMagick in my system (windows), and its commands are there in system PATH. Its working absolutely fine through Command line I want to call the "convert" function of ImageMagick from Matlab using system command. 'C:\Users\Vivek' is the Path to image. I have to test working of ImageMagick through Matlab, as i need it in further processing (Making input suitable to Tesseract OCR)

    cmd= ['convert ' 'C:\Users\Vivek\208.jpg ' 'C:\Users\Vivek\208.png']
    system(cmd);

它说无效参数-C:\ Users \ Vivek \ 208.png,我尝试了其他方法.但是,问题一直出在第二个参数上.

It says Invalid Parameter - C:\Users\Vivek\208.png, I tried some other ways. But, all the time the problem is with the second parameters.

需要帮助

谢谢

推荐答案

Windows附带了自己的convert程序,您似乎正在调用该程序,因为它首先在此上下文中出现.在ImageMagick的网站上对此进行了描述: http://www.imagemagick.org/Usage/windows/# convert_issue

Windows comes with its own convert program, and it looks like you're calling that one because it's first on the path in this context. It's described here on ImageMagick's site: http://www.imagemagick.org/Usage/windows/#convert_issue

我没有安装ImageMagick,并且在尝试调用convert时收到相同的错误消息.这与您的代码获取了错误的convert程序相符.

I do not have ImageMagick installed, and I get the same error message when I try calling convert. That's consistent with your code getting the wrong convert program.

C:\Users\janke>convert C:\Users\Vivek\286.jpg C:\Users\Vivek\208.png
Invalid Parameter - C:\Users\Vivek\208.png

指定ImageMagick的convert程序的完整路径,它应该对您有用.

Specify the full path to ImageMagick's convert program and it should work for you.

这篇关于从Matlab调用ImageMagick时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆