12.07.2022
- Ubuntu 20.0.4
- ROS Noetic
- apt OpenCV v4.2.0
- upstream OpenCV v4.6.0
sudo apt install libopencv-dev
will install OpenCV in/usr/include/...
, but in the official documentation) path is different- I just made a semlynk from
/usr/local/include/opencv4/opencv2
to/usr/include/opencv4/opencv2
after renaiming the last one original toopencv2_recovery
vision_opencv
ROS package also should be built from scretch. Just clone it to your workspace andcatkin clean; catkin build
How to compile OpenCV2 behind with OpenCV4 on Ubuntu 20.0.4 for OCamCalib usage with automated cornes extraction in year 2022
- Download the official sources to some directory (for example ~/Downloads)
- In
CMakeLists.txt
change theCMAKE_INSTALL_PREFIX
to some path (for example ~/libs/opencv2) - Change the Makefile in OCamCalib to:
INCS = -I/home/$USER/libs/opencv2/include
LIBS = -L/home/$USER/libs/opencv2/lib
LINKLIBS = -lopencv_core -lopencv_highgui -lopencv_imgproc
CPP = g++
CC = gcc
OBJ = main.o cvcalibinit3.o
LINKOBJ = main.o cvcalibinit3.o
BIN = FindCorners.exe
RM = rm -f
all: $(BIN)
clean:
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CPP) $(LINKOBJ) -g -o $(BIN) $(LIBS) $(LINKLIBS)
main.o: main.cpp
$(CPP) -c -g main.cpp -o main.o $(INCS)
cvcalibinit3.o: cvcalibinit3.cpp
$(CPP) -c -g cvcalibinit3.cpp -o cvcalibinit3.o $(INCS)
(not a lot of changes)
- Also some additional shared libraries for Matlab and OpenCV should be installed (which one - it will be written in the output of the OCamCalib during the calibration process)