Closed wanghaisheng closed 6 years ago
ocropus-gpageseg -n –csminheight 100000 –usegauss ––gray left.bin.png right.bin.png
root@fa990931144e:/ocropy# ocropus-nlbin -e -10.0 -g -z 5.0 -n pic/lab/e2044f07jw1f7c7gx4fuoj20rs0kutgf.jpg -o pic/lab/e2044f07jw1f7c7gx4fuoj20rs0kutgf-01
INFO: # pic/lab/e2044f07jw1f7c7gx4fuoj20rs0kutgf.jpg
INFO: === pic/lab/e2044f07jw1f7c7gx4fuoj20rs0kutgf.jpg 1
INFO: flattening
INFO: estimating skew angle
INFO: estimating thresholds
INFO: rescaling
INFO: pic/lab/e2044f07jw1f7c7gx4fuoj20rs0kutgf.jpg lo-hi (0.86 1.11) angle 1.0
INFO: writing
root@fa990931144e:/ocropy# ocropus-gpageseg --csminheight 100000 --usegauss --gray pic/lab/e2044f07jw1f7c7gx4fuoj20rs0kutgf-01/0001.bin.png
INFO:
INFO: ########## /usr/local/bin/ocropus-gpageseg --csminheight 100000 --usega
INFO:
INFO: pic/lab/e2044f07jw1f7c7gx4fuoj20rs0kutgf-01/0001.bin.png
ERROR: pic/lab/e2044f07jw1f7c7gx4fuoj20rs0kutgf-01/0001.bin.png SKIPPED too many connnected components for a page image (4132 > 833) (use -n to disable this check)
root@fa990931144e:/ocropy# ocropus-gpageseg --csminheight 100000 --usegauss pic/lab/e2044f07jw1f7c7gx4fuoj20rs0kutgf-01/0001.bin.png
INFO:
INFO: ########## /usr/local/bin/ocropus-gpageseg --csminheight 100000 --usega
INFO:
INFO: pic/lab/e2044f07jw1f7c7gx4fuoj20rs0kutgf-01/0001.bin.png
ERROR: pic/lab/e2044f07jw1f7c7gx4fuoj20rs0kutgf-01/0001.bin.png SKIPPED too many connnected components for a page image (4132 > 833) (use -n to disable this check)
root@fa990931144e:/ocropy# ocropus-gpageseg --csminheight 100000 --usegauss -n pic/lab/e2044f07jw1f7c7gx4fuoj20rs0kutgf-01/0001.bin.png
INFO:
INFO: ########## /usr/local/bin/ocropus-gpageseg --csminheight 100000 --usega
INFO:
INFO: pic/lab/e2044f07jw1f7c7gx4fuoj20rs0kutgf-01/0001.bin.png
INFO: scale 16.492423
INFO: computing segmentation
INFO: computing column separators
INFO: considering at most 3 whitespace column separators
INFO: computing lines
INFO: propagating labels
INFO: spreading labels
INFO: number of lines 21
INFO: finding reading order
INFO: writing lines
INFO: 20 pic/lab/e2044f07jw1f7c7gx4fuoj20rs0kutgf-01/0001.bin.png 16.5 21
root@fa990931144e:/ocropy#
vips pdfload pdf/1.pdf --dpi 300 pdf/1.default.jpg
➜ OCRopus git:(master) ✗ curl -F "image=@01.jpg" -F "threshold=0.5" -o 01.bin.png http://localhost:8001/binarizationapi
➜ OCRopus git:(master) ✗ curl -F "image=@01.bin.png" -F "threshold=0.5" -o 01.zip http://localhost:8002/segmentationapi
➜ OCRopus git:(master) ✗ curl -F "image=@01/01.bin_31.png" -F "probabilities=True" -o 01ocr.zip http://localhost:8003/recognitionapi
docker@966fe1e78237:~/pic/xuetang$ ocropus-nlbin -e -10000.0 -g -z 5.0 -n IMG_20170922_142015.jpg
参考 github code Optimizing Binarization for OCRopus