Instructions to compile and use Opencv API Wrapper Lazarus on Linux :
1 - Install Opencv 4.6 from source :
# Install minimal prerequisites (Ubuntu 20.04 as reference)
sudo apt update && sudo apt install -y cmake g++ wget unzip
# Download and unpack sources
wget -O opencv.zip https://github.com/opencv/opencv/archive/4.x.zip
unzip opencv.zip
# Create build directory in the opencv directory
mkdir -p build && cd build
# Configure
cmake ../opencv-4.x
# Build
cmake --build .
# Install
sudo make install
2 - Download or git clone the Opencv version 4.6 C++ API wrapper project from github
create a new folder source-linux and put the content of source inside.
delete dllmain.cpp
modify wrapper.cpp :
#include "opencv2/kdtree.hpp"
modify the HOME variable in the
Makefile with your HOME
======================================
Modify the file precomp.hpp in the include files of opencv
precomp.hpp in opencv-4.6.0/modules/core/include:
//#include "opencv2/core/private.hpp"
======================================
in a terminal cd in the
source-linux folder and try the command
makeif it is OK copy the so file in the /usr/lib. example :
sudo cp libocvCPPWrapper46.so /usr/libsudo ldconfigtry the project in the folder
examples-Lazarus-Linux/featureTestyou need
qt5 installed to compile and run this project
enjoy !