ΔBF is an image binarization framework written in C++ which focuses primarily on local adaptive thresholding algorithms. In English, this means that it has the ability to turn a color or gray scale image into a black and white image.
Algorithms
Optimizations
Performance Metrics
Native Image Support
The goal of this library is to provide the building blocks one might use to advance the state of handwritten manuscript binarization. What sets this binarization library apart is that it is intended to be used by those interested in experimenting with their own algorithms and enhancements. Instead of being relegated to MATLAB, or obfuscated by mathematics in a research paper, a lot of effort has gone into exposing these binarization techniques in an open and transparent way. A key objective in designing this framework was to make it modular and as easy to use as possible, without sacrificing speed and without depending heavily on 3rd party frameworks. This library is also heavily unit tested to help ensure quality, and to quickly spot problems after experimenting with the codebase.
This short example shows you how easy it is to use ΔBF to process an image.
// Read a 32-bit color image and automatically convert to 8-bit gray scale
Image image = PNM::Read(R"(C:\MyImage.pam)");
// Use a binarization algorithm to convert it into black and white
const Parameters parameters({ {"window", 25}, {"k", 0.10} });
Image imageSauvola = Sauvola::ToBinaryImage(image, parameters);
// Save the processed image
PNM::Write(imageSauvola, R"(C:\MyImage-Sauvola.pam)");
// Qt has great support for working with complex file formats
// Prompt the user to select an image to open, using Qt
QString imagePath =
QFileDialog::getOpenFileName(
this,
tr("Open File"),
"",
tr("JPEG (*.jpg *.jpeg);;PNG (*.png)"));
// Load the image into a Qt QImage
QImage qImage(imagePath);
// Use Qt to convert to 8-bit grayscale
qImage = qImage.convertToFormat(QImage::Format_Grayscale8);
// Operations on the ΔBF Image will directly change the QImage when set as a reference.
Image image = Image::Reference(qImage.width(), qImage.height(), (Pixel8*)qImage.bits());
Niblack::UpdateToBinary(image, Parameters());
// Save the updated QImage to the file system, using Qt
qImage.save("binary-image.png");
Other examples can be found in the Demo folder, like the BinaryImageConverter tool.
Another thing that sets ΔBF apart is its focus on binarization performance. The PerformanceMetrics demo highlights how easy it is to get detailed metrics given a sample output and a ground-truth.
Experimental WASM support has been added in order to expose ΔBF to the web. With the provided JavaScript wrapper, it is easy to utilize this framework in any web project. A Live Demo has been created to highlight some of what ΔBF is capable of on the web.
CC0 - Brandon M. Petty, 2019
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
"Freely you have received; freely give." - Matt 10:8
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。