4
Я пытался читать изображения в Java с библиотекой im4java:im4java читать изображение
File file = new File("img\\test.jpg");
Info imageInfo = new Info(file.getPath(),true);
Проблема заключается в том, что информация() don't распознать изображение. Вызывается исключение:
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)