Comments (5)
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")
from doxa.
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
from doxa.
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.)
from doxa.
Very kind of you to walk me through this. Success! I have it working in R now on Windows. Very much appreciated.
from doxa.
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!
from doxa.
Related Issues (15)
- version of c++ HOT 3
- std::get on Mac OS HOT 5
- building with Pybind11 on Windows HOT 11
- specifying binarization method in python HOT 3
- Any plan to support pip install for the Python binding HOT 11
- [Feature request] AdOtsu, adaptive Otsu's method HOT 9
- Documentation - Parameter Defaults HOT 1
- skewed large images HOT 3
- GPU Support (CUDA) HOT 1
- Wan algorithm is slowly if window size more than 17? HOT 1
- pseudo F-measure, single metrics in Doxapy, and `eps` for numerical stability? HOT 9
- Thank you HOT 1
- Fast implementation of Sauvola-alike methods without integral images HOT 8
- Incorrect binarization algorythm in Demo Application HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doxa.