Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't get it to work on Windows #3

Open
SB2020-eye opened this issue Aug 20, 2020 · 4 comments
Open

Couldn't get it to work on Windows #3

SB2020-eye opened this issue Aug 20, 2020 · 4 comments

Comments

@SB2020-eye
Copy link

Hi. I know little to no C++. I saw your disclaimer about Windows. I'm just reporting that I couldn't get it to work on Windows (Win10, using Visual Studio Code). But the problem could very well be me. I don't know how to "compile" something in C++ , for example. (Though I did try, search the web, and try again for the past 4 hours or so.)

If anyone has any suggestions to get it working, that would be much appreciated by this novice.

Thanks!

@chriswolfvision
Copy link
Owner

Hi, as I said, I don't work on windows - that's the choices one can make when working in academia.
If somebody wants to port it, be me guest, but I am not willing to do it.

Best regards,
Christian

@SB2020-eye
Copy link
Author

I do understand, Christian. :) All the best to you.

If someone else comes along that can make it work in Windows (or in python), great. Please add to the thread. :)

@woctezuma
Copy link

woctezuma commented Jul 19, 2021

If someone else comes along that can make it work in Windows (or in python), great. Please add to the thread. :)

I am on Windows, and I have used the Python plug-in for GIMP which is mentioned in the README.

https://github.com/chriswolfvision/local_adaptive_binarization#gimppython-version

The installation is as simple as copying a .py file in the right folder.
The usage consists in running pressing a button in GIMP itself.

@char101
Copy link

char101 commented Jul 13, 2022

Compilation on Windows:

Source modification:

diff --git a/binarizewolfjolion.cpp b/binarizewolfjolion.cpp
index e92d124..dcf8c4a 100644
--- a/binarizewolfjolion.cpp
+++ b/binarizewolfjolion.cpp
@@ -13,8 +13,8 @@
  **************************************************************/

 #include <stdio.h>
-#include <unistd.h>
-#include <getopt.h>
+//#include <unistd.h>
+#include "getopt.h"
 #include <iostream>
 // #include <cv>
 // #include <highgui>
@@ -377,7 +377,7 @@ int main (int argc, char **argv)


     // Load the image in grayscale mode
-    Mat input = imread(inputname,CV_LOAD_IMAGE_GRAYSCALE);
+    Mat input = imread(inputname,cv::ImreadModes::IMREAD_GRAYSCALE);


     if ((input.rows<=0) || (input.cols<=0)) {

Compilation script (modify as required):

@echo off
setlocal
set OPENCV_DIR=T:\OCR\opencv
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" amd64
if not exist getopt.h curl -O https://raw.githubusercontent.com/skandhurkat/Getopt-for-Visual-Studio/master/getopt.h
cl /MT /O2 /arch:AVX2 /Gw /EHsc /I %OPENCV_DIR%\build\include binarizewolfjolion.cpp %OPENCV_DIR%\build\x64\vc15\lib\opencv_world460.lib
if not exist opencv_world460.dll copy %OPENCV_DIR%\build\x64\vc15\bin\opencv_world460.dll .
endlocal

Compiled executable (NOTE: to run it requires opencv_world460.dll from opencv directory, I don't include it here since it is a 64MB dll) (virustotal result):

binarizewolfjolion.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants