glencoesoftware / bioformats2raw

Bio-Formats image file format to raw format converter
GNU General Public License v2.0
82 stars 36 forks source link

Update opencv to 4.7.0-0 #212

Closed melissalinkert closed 1 year ago

melissalinkert commented 1 year ago

Fixes #210, see https://github.com/openpnp/opencv/compare/v3.4.2-0...v4.7.0

CGDogan commented 1 year ago

thanks

CGDogan commented 1 year ago

For OS-1.ndpi.tiff from OpenSlide repo, the 7.0.0 release prints:

2023-08-18 15:47:45,104 [main] WARN  c.g.bioformats2raw.OpenCVTools - Could not load OpenCV libraries
java.lang.ExceptionInInitializerError: null
    at nu.pattern.OpenCV$LocalLoader.getInstance(OpenCV.java:307)
    at nu.pattern.OpenCV.loadLocally(OpenCV.java:290)
    at com.glencoesoftware.bioformats2raw.OpenCVTools.loadOpenCV(OpenCVTools.java:34)
    at com.glencoesoftware.bioformats2raw.Converter.call(Converter.java:1080)
    at com.glencoesoftware.bioformats2raw.Converter.call(Converter.java:104)
    at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
    at picocli.CommandLine.access$1300(CommandLine.java:145)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
    at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:2172)
    at picocli.CommandLine.parseWithHandlers(CommandLine.java:2550)
    at picocli.CommandLine.parseWithHandler(CommandLine.java:2485)
    at picocli.CommandLine.call(CommandLine.java:2761)
    at com.glencoesoftware.bioformats2raw.Converter.main(Converter.java:2826)
Caused by: java.lang.UnsupportedOperationException: Architecture "aarch64" is not supported.
    at nu.pattern.OpenCV$Arch.getCurrent(OpenCV.java:91)
    at nu.pattern.OpenCV.extractNativeBinary(OpenCV.java:316)
    at nu.pattern.OpenCV.access$100(OpenCV.java:22)
    at nu.pattern.OpenCV$LocalLoader.<init>(OpenCV.java:296)
    at nu.pattern.OpenCV$LocalLoader.<init>(OpenCV.java:293)
    at nu.pattern.OpenCV$LocalLoader$Holder.<clinit>(OpenCV.java:303)
    ... 15 common frames omitted
2023-08-18 15:47:45,108 [main] WARN  c.g.bioformats2raw.OpenCVTools - Could not load native library opencv_java342
java.lang.UnsatisfiedLinkError: no opencv_java342 in java.library.path: /Users/zerf/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2444)
    at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:880)
    at java.base/java.lang.System.loadLibrary(System.java:2051)
    at com.glencoesoftware.bioformats2raw.OpenCVTools.loadOpenCV(OpenCVTools.java:41)
    at com.glencoesoftware.bioformats2raw.Converter.call(Converter.java:1080)
    at com.glencoesoftware.bioformats2raw.Converter.call(Converter.java:104)
    at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
    at picocli.CommandLine.access$1300(CommandLine.java:145)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
    at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:2172)
    at picocli.CommandLine.parseWithHandlers(CommandLine.java:2550)
    at picocli.CommandLine.parseWithHandler(CommandLine.java:2485)
    at picocli.CommandLine.call(CommandLine.java:2761)
    at com.glencoesoftware.bioformats2raw.Converter.main(Converter.java:2826)

Then I replaced the dependency jar with version 4.7.0-0 and renamed it to the previous filename. Now it does start using 400% CPU without such an error. (Please note that to test this I use my patched BioFormats https://github.com/ome/bioformats/pull/4042 which of course BioFormats should crosscompile rather than to use my precompiled binary)