chriswolfvision / local_adaptive_binarization

Local adaptive image binarization
125 stars 25 forks source link

Working with opencv4 #4

Open brossaip opened 3 years ago

brossaip commented 3 years ago

Hi!

I'm using your binarization implementation and it has worked well for me. Thanks a lot for your implementation. Unfortunately, it has stopped to work when I have updated opencv to release 4.

I have modified the makefile replacing the compiling command by: g++ binarizewolfjolion.cpp -o binarizewolfjolion 'pkg-config --libs --cflags opencv4' -lstdc++

In the code I have had to add #include <opencv2/imgcodecs.hpp> and to replaceMat input = imread(inputname,CV_LOAD_IMAGE_GRAYSCALE); by Mat input = imread(inputname,cv::ImreadModes::IMREAD_GRAYSCALE);

That's all.

I hope is useful for someone.

nowakf commented 2 years ago

very useful: I would like to add: you need some libraries installed (opencv and vtk, I think) or you get a ton of linker errors