Skip to content

Instantly share code, notes, and snippets.

@nigelkerr
nigelkerr / hocr.frag.html
Created November 6, 2016 19:46
fragment of html to add to the head of a hocr file to use the hocr.css and hocr.js here.
<link rel="stylesheet" type="text/css" href="hocr.css"></link>
<script src="https://code.jquery.com/jquery-3.1.1.js"></script>
<script src="hocr.js"></script>
@nigelkerr
nigelkerr / hocr.css
Created November 6, 2016 19:45
css to add to a hocr file to make it easier to see the recognized regions.
.ocr_page, .ocr_carea, .ocr_par, .ocr_line, .ocrx_word {
margin: 0px;
padding: 0px;
}
.ocr_page {
border: thin green dotted;
}
.ocr_carea {
@nigelkerr
nigelkerr / hocr.js
Created November 6, 2016 19:44
js to include in a hocr file to make it easier to see the document regions recognized
$( document ).ready(function() {
var bbox_re = /bbox (\d+) (\d+) (\d+) (\d+)/i;
var posr = function(i) {
var t = $(this).attr('title');
var result = t.match(bbox_re);
if ( result ) {
var top = result[2] / 3;
var left = result[1] / 3;

Keybase proof

I hereby claim:

  • I am nigelkerr on github.
  • I am nigelkerr (https://keybase.io/nigelkerr) on keybase.
  • I have a public key ASBzsdrOH6Yq9d7nHxJ5jCt551k2AUizPB1-J1J2u3iGiwo

To claim this, I am signing this object: