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

Using on Windows #11

Closed
SB2020-eye opened this issue Aug 21, 2020 · 5 comments
Closed

Using on Windows #11

SB2020-eye opened this issue Aug 21, 2020 · 5 comments

Comments

@SB2020-eye
Copy link

Has anyone had success using this on Windows?

If so, would you be willing to give simple instructions to a total beginner about how to get it up and running?

Any guidance would be much appreciated!

(Windows 10)

@jwijffels
Copy link

I'm on Windows and wrote this R wrapper at https://cran.r-project.org/web/packages/image.binarization/index.html.
Examples at https://cran.r-project.org/web/packages/image.binarization/readme/README.html and more examples by looking at the documenation of ?image_binarization

@SB2020-eye
Copy link
Author

Thank you so much, @jwijffels

I sheepishly admit -- I actually downloaded image.binarization yesterday to see if I could figure it out...and I couldn't. :(

I have a feeling that at least in part it has to do with "the package requires a compiler with C++17 capabilities." I don't even know if I have this, much less how to do it. (Ha.)

For what it's worth, I understand a very little of Python, use Visual Studio Code, and my goal is for image results more than programming. (I'm here because I'm looking for an optimal binarization method for separating sometimes faded glyphs from backgrounds (with multivariate tones from aging and the like) on a historical manuscript. I came across Doxa and image.binarization searching for "improved Sauvola" in Google.)

@jwijffels
Copy link

You just need to install R (at least version >4) at https://cran.r-project.org/bin/windows/base/

Then in R install the package as follows:

install.packages("image.binarization")
install.packages("magick")

And run the code where you replace scan.jpg with the path to your image.

library(magick)
library(image.binarization)
img <- image_read("scan.jpg")
img <- image_convert(img, format = "PGM", colorspace = "Gray")
img
img_blackwhite <- image_binarization(img, type = "su")
img_blackwhite

img_blackwhite<- image_binarization(img, type = "sauvola", opts = list(window = 75L, k = 0.2)
img_blackwhite
image_write(img_blackwhite, "test.png")

@SB2020-eye
Copy link
Author

Very kind of you to walk me through this. Success! I have it working in R now on Windows. Very much appreciated.

@jwijffels
Copy link

jwijffels commented Aug 24, 2020

Good to know it worked - I'm using the R wrapper for image cleaning in order to find text lines in scans of 18th-19th century documents https://github.com/DIGI-VUB/image.textlinedetector as well as some preprocessing in Handwritten text recognition at https://github.com/DIGI-VUB/HTR-tests.
Great toolkit, Doxa!

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

2 participants