I'm trying to install OpenCV4 on Debian 10 server. I followed the official docs , but compiling I get
In file included from /root/opencv/modules/imgcodecs/src/grfmt_jpeg2000_openjpeg.cpp:10:
/root/opencv/modules/imgcodecs/src/grfmt_jpeg2000_openjpeg.hpp:13:10: fatal error: openjpeg.h: No such file or directory
#include <openjpeg.h>
^~~~~~~~~~~~
compilation terminated.
I installed openjpeg
separately from source (this guide)
But it did not help.
I also tried to install opencv4 using pip3 install opencv-python
but again, I failed:
An error occurred while building with CMake. Command: cmake --build . --target install --config Release -- Install target: install Source directory: /tmp/pip-install-58cut84q/cmake Working directory: /tmp/pip-install-58cut84q/cmake/_skbuild/linux-x86_64-3.7/cmake-build Please check the install target is valid and see CMake's output for more information.
---------------------------------------- Command "/usr/bin/python3 -u -c "import setuptools,
tokenize;file='/tmp/pip-install-58cut84q/cmake/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-wvupk349/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-uyj03w3k --compile" failed with error code 1 in /tmp/pip-install-58cut84q/cmake/
So I'm left clueless and appreciate your help.