【问题标题】:im4java read an imageim4java 读取图像
【发布时间】:2013-06-12 18:32:20
【问题描述】:

我尝试使用库 im4java 读取 Java 中的图像:

File file = new File("img\\test.jpg");
Info imageInfo = new Info(file.getPath(),true);

问题是 Info() 无法识别图像。调用异常:

Exception in thread "main" org.im4java.core.InfoException: org.im4java.core.CommandException:      java.io.IOException: Cannot run program "identify": CreateProcess error=2, The sistem can not find the specific file.
at org.im4java.core.Info.getBaseInfo(Info.java:360)
at org.im4java.core.Info.<init>(Info.java:151)
at FeatureExtractor.main(FeatureExtractor.java:51)

在路线中,我试图放置完整的路线,但它不起作用。然后我尝试用命令和操作来做,还是不行:

    // create command
ConvertCmd cmd = new ConvertCmd();
//cmd.setSearchPath("img");

// create the operation, add images and operators/options
IMOperation op = new IMOperation();
op.addImage("img\\test.jpg");

错误是:

org.im4java.core.CommandException: org.im4java.core.CommandException: Specification not valid.
at org.im4java.core.ImageCommand.run(ImageCommand.java:219)
at FeatureExtractor.main(FeatureExtractor.java:28)

【问题讨论】:

    标签: java image im4java


    【解决方案1】:

    您可以设置ImageMagick安装的搜索路径并尝试: ProcessStarter.setGlobalSearchPath("$PATH:");

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-10-29
      • 1970-01-01
      • 2012-02-29
      • 2014-09-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多