opencv-dcm Fork/Repository

226 views
Skip to first unread message

Patrick Peer

unread,
Apr 10, 2020, 5:48:47 AM4/10/20
to dcm4che
Hi!

I need to deploy an application using dcm4che on a centOS 6 machine. Unfortunately it comes with GNU libc 2.12, and the opnecv-4.1.1 native library, which Nicolas Roduit hosts on GitHub [1], seems to require at least GNU libc 2.14.
So, I tried to compile openCV against GNU libc 2.12. The compilation was successful, but some Dicom related functions are not exported in the resulting shared object (dicomJpgMatRead, for example). As I could not find them in the vanilla version of openCV [2] I suspect that there are some dcm4che or Weasis specific additions. However, I could not find any site or repository where they are published.
Also, I contacted Nicolas Roduit directly some days ago, but received no answer yet.

Can someone point me to the source code of Nicolas' published binaries [1], and/or does anybody know Nicolas' (holiday-)schedule?


Thanks, Patrick

[1] https://github.com/nroduit/mvn-repo/tree/master/org/weasis/thirdparty/org/opencv/libopencv_java

Nicolas Roduit

unread,
Apr 13, 2020, 10:56:26 AM4/13/20
to dcm4che
The libopencv_java.so (4.1.1 and 4.2.0) supports 
  • Linux 64-bit: GLIBC_2.14
  • Linux 32-bit: GLIBC_2.11
I'm experimenting builds with crosstool-ng to allow compiling by being able to choose the version of kernel and of glibc. However, it is still experimental and it only works from version 4.2.0.

It seems a bit surprising to me of installing an application on a system that will no longer be supported before the end of the year 2020. If you absolutely need to install on Centos 6 then you should try to update glibc, see https://gist.github.com/harv/f86690fcad94f655906ee9e37c85b174

Patrick Peer

unread,
Apr 14, 2020, 4:22:18 AM4/14/20
to dcm4che
Well, as IT life goes, the things one should do, must do and feasibly can do do not always align. I am sure you can relate ;). Of course I am confronted with more constraints than I outlined here. Incidentally, I personally think you _should_ publish your additions/changes to openCV, even though the BSD license allows you to keep them proprietary. However, I also assume you need to deal with one constraint or another of your own in that matter. 

In any case, I am afraid the solution you proposed is not really an option for us, unfortunately. Of course the 32-bit version does not work either, because it is the wrong ELF class for our system. So. I'd like to ask you for a version of libopencv_java-4.1.1-dcm-linux-x86-64.so [1] that is linked against GLIBC 2.12. I'd be happy to save you the hassle and compile it myself, but as it seems, this also is not an option right now.

Cheers, Patrick


Patrick Peer

unread,
Apr 20, 2020, 8:44:44 AM4/20/20
to dcm4che
Nicolas,

at the very least a definitive answer, whether you can and will provide a binary or not, would be very much appreciated.

Thanks, Patrick

Nicolas Roduit

unread,
Apr 22, 2020, 8:02:00 AM4/22/20
to dcm4che
Here is a binary for version 4.2.0 x86_64. It seems to require at most GLIBC_2.7 although I had put a dependency on GLIBC_2.11. I haven't tried if it works correctly.
Version 4.1.1 doesn't compile and I can't invest more time on it.

Patrick Peer

unread,
Apr 22, 2020, 5:15:43 PM4/22/20
to dcm...@googlegroups.com
The binary passed a simple smoke test. It loaded just fine in the specific environment. However, upon more thorough testing, it became apparent that there is a breaking change between 4.1.1 and 4.2.0. Most of the test failures I encounter are caused by minuscule differences in generated images (I assume, I did not check every single generated image yet). That should be fine, but then there are failed assertions within the native code, which of course I neither can analyse nor address. 

Caused by: CvException [org.opencv.core.CvException: cv::Exception: OpenCV(4.2.0) /home/nicolas/Workspaces/git/opencv/modules/imgcodecs/src/loadsave.cpp:1205: error: (-215:Assertion failed) code in function 'dicomJpgWrite'
]
at org.opencv.imgcodecs.Imgcodecs.dicomJpgWrite_0(Native Method)
at org.opencv.imgcodecs.Imgcodecs.dicomJpgWrite(Imgcodecs.java:260)
at org.dcm4che3.opencv.NativeJPEGImageWriter.write(NativeJPEGImageWriter.java:150)

Whether this is a bug or an incompatibility with the interfacing Java code seems to be irrelevant at this point, since the version of dcm4che is fixed within our current release cycle and you "can't invest more time on it", anyway. So ... thanks for the effort, I guess.

Nicolas Roduit

unread,
Apr 24, 2020, 2:00:39 AM4/24/20
to dcm4che
Only replacing the native library would not work because the API has changed between 4.1.1 and 4.2.0. You need to replace at least the related packages dcm4che-imageio-opencv and weasis-opencv-core.

Patrick Peer

unread,
Apr 24, 2020, 3:20:06 AM4/24/20
to dcm4che
Nicolas,

this is pretty much what I expected, but despite my doubts I tried it anyway. As I wrote, the version of dcm4che is fixed for our current release, and by extension so are the versions of dcm4che-imageio-opencv and weasis-opencv-core, so this was the best option I had.

I am not interested in any workarounds, however good your intentions are. Unless you can grant me access to your source code (even patches would suffice), or produce a binary in the exact required version (libopencv_java-4.1.1, 64 bit, linked agains GLIBC 2.12), you are not really helping out.
Reply all
Reply to author
Forward
0 new messages