Closed quentinmarolleau closed 3 years ago
The cv2 package is only used in the Xenics
class, in order to load the 16bit png images: see the code here.
I used it because matplotlib/scipy did not manage to load it directly as a 16bit array, which then requires to do some clumsy rescaling... Here is where I found my solution: https://stackoverflow.com/questions/32622658/read-16-bit-png-image-file-using-python
I think that @QuantumVictor and @charlieleprince have been experiencing the same issue. Feel free to find another package to load the 16bit data and to patch the Xenics
class accordingly. This should not have any impact on the rest of the code
I had the same issue indeed. Solved it by uninstalling opencv and then installing instead:
opencv-python-headless
(using pip3)
OK. So far I've been installing packages on my local virtual environment without really checking what's really needed. At some point, we should try to come up with an 'official' requirement list, in the form of a pip-compatible requirements.txt
I agree.
The fix proposed by @charlieleprince worked indeed for me. opencv-python-headless
is intended for server use and do not embed GUI dependencies (loaded already in matplotlib
)...
Btw this kind of issue seems fairly common on the web (in various contexts) and is apparently due to a compatibility clash between matplotlib
and opencv
during the package loading process. I think that we should create a dedicated issue to investigate a proper way to manage this problem => https://github.com/adareau/HAL/issues/33#issue-896823735
Ubuntu 20.04.2 LTS
After creating a HAL virtualenv, and locally installing the required packages, the terminal returns this at startup:
It seems to be related to a wrong openCV loading