Algorithm Engineering
Friedrich Schiller University Jena
Report Bug
Free tool (executable) for improving the quality of scanned documents before printing (or sending) them.
- Input: portable pix map (ppm) color image(s) in ASCII-format (P3)
- Tool to convert image to P3 ppm image: IrfanView
⚠️ IrfanView writes a comment in the image which must be deleted with a texteditor:
P3 # Created by IrfanView <-- delete this line and save file 1440 809
- Tool to convert image to P3 ppm image: IrfanView
- Output: cleaned ppm image(s) in ASCII-format
- C++
- CMake
To compile the project a c++ compiler and cmake is needed. If it is missing execute the following commands:
sudo apt update
sudo apt install cmake
sudo apt install gcc
Next, the project must be copied locally:
git clone https://github.com/Kr3b5/fsu-algoeng.git
Now you can go into the project
directory and start the build:
cmake -B build
cmake --build build
No CMAKE_CXX_COMPILER could be found
run the following command:
export CXX=[path to g++]/g++ (default: /usr/bin/g++)
✅ If the build was successful, the executable file can be found under project/build/scanEnhancer
To test the project the following commands can be used:
catch2 (more detailed):
cd /project/build
./scanEnhancer_tests
ctest:
cd /project/build
ctest
usage: scanEnhancer <path input file> <path output file> [filters]
filter (needs at least one filter):
-g <radius> apply gauss filter with radius
-t <radius> <C> <text mode> apply mean threshold filter with radius and offset C
> text mode = [0 = off | 1 = on]
-g
- Gaussian filter to reduce noise, but blurrs the image-t
- Mean threshold to remove background and shadows in text images- ℹ️ text mode = Colors all pixels that are not removed black for better readability
Example for img/in.ppm
:
./scanEnhancer ../img/in.ppm ../img/out.ppm -g 3 -t 10 5 1
Input | Output | Output - Textmode |
---|---|---|