Created
January 31, 2014 08:03
-
-
Save wincentbalin/8728168 to your computer and use it in GitHub Desktop.
Makefile for batch OCR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONVERT = convert | |
IMFLAGS = -verbose -colorspace gray -median 3x3 -resize 300% -blur 10 | |
TESSERACT = tesseract | |
RM = rm | |
SRCS = $(wildcard *.pbm) | |
INTERMEDIATES = ${SRCS:.pbm=.tiff} | |
RESULTS = ${SRCS:.pbm=.txt} | |
.PHONY: all | |
all: $(RESULTS) | |
.PRECIOUS: $(INTERMEDIATES) | |
clean: | |
$(RM) -f $(INTERMEDIATES) $(RESULTS) | |
%.tiff: %.pbm | |
$(CONVERT) $(IMFLAGS) $< $@ | |
%.txt: %.tiff | |
$(TESSERACT) $< $(basename $@) -l deu | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment