All Projects → dbmdz → mirador-textoverlay

dbmdz / mirador-textoverlay

Licence: MIT license
Text Overlay plugin for Mirador 3

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to mirador-textoverlay

dinglehopper
An OCR evaluation tool
Stars: ✭ 38 (+8.57%)
Mutual labels:  ocr, alto-xml, alto
kitodo-presentation
Kitodo.Presentation is a feature-rich framework for building a METS- or IIIF-based digital library. It is part of the Kitodo Digital Library Suite.
Stars: ✭ 33 (-5.71%)
Mutual labels:  iiif, alto-xml, alto
ocr-fileformat
Validate and transform various OCR file formats (hOCR, ALTO, PAGE, FineReader)
Stars: ✭ 142 (+305.71%)
Mutual labels:  ocr, hocr, alto
Tesseract4android
Fork of tess-two rewritten from scratch to support latest version of Tesseract OCR.
Stars: ✭ 148 (+322.86%)
Mutual labels:  ocr, optical-character-recognition
Ssocr
Seven Segment Optical Character Recognition
Stars: ✭ 133 (+280%)
Mutual labels:  ocr, optical-character-recognition
Easyocr
Ready-to-use OCR with 80+ supported languages and all popular writing scripts including Latin, Chinese, Arabic, Devanagari, Cyrillic and etc.
Stars: ✭ 13,379 (+38125.71%)
Mutual labels:  ocr, optical-character-recognition
Eyevis
Android based Vocal Vision for Visually Impaired. Object Detection, Voice Assistance, Optical Character Reader, Read Aloud, Face Recognition, Landmark Recognition, Image Labelling etc.
Stars: ✭ 48 (+37.14%)
Mutual labels:  ocr, optical-character-recognition
Android Ocr
Experimental optical character recognition app
Stars: ✭ 2,177 (+6120%)
Mutual labels:  ocr, optical-character-recognition
Ocr Table
Extract tables from scanned image PDFs using Optical Character Recognition.
Stars: ✭ 165 (+371.43%)
Mutual labels:  ocr, optical-character-recognition
hOCR-to-ALTO
Convert between Tesseract hOCR and ALTO XML using XSL stylesheets
Stars: ✭ 40 (+14.29%)
Mutual labels:  hocr, alto
Image2text
📋 Python wrapper to grab text from images and save as text files using Tesseract Engine
Stars: ✭ 243 (+594.29%)
Mutual labels:  ocr, optical-character-recognition
Tesserocr
A Python wrapper for the tesseract-ocr API
Stars: ✭ 1,567 (+4377.14%)
Mutual labels:  ocr, optical-character-recognition
Penteract Ocr
⭐️ The native node.js bindings to the Tesseract OCR project.
Stars: ✭ 86 (+145.71%)
Mutual labels:  ocr, optical-character-recognition
Swiftytesseractrte
SwiftyTesseract Real-Time Engine
Stars: ✭ 49 (+40%)
Mutual labels:  ocr, optical-character-recognition
Signature extractor
A super lightweight image processing algorithm for detection and extraction of overlapped handwritten signatures on scanned documents using OpenCV and scikit-image.
Stars: ✭ 205 (+485.71%)
Mutual labels:  ocr, optical-character-recognition
doctr
docTR (Document Text Recognition) - a seamless, high-performing & accessible library for OCR-related tasks powered by Deep Learning.
Stars: ✭ 1,409 (+3925.71%)
Mutual labels:  ocr, optical-character-recognition
Swiftytesseract
A Swift wrapper around Tesseract for use in iOS, macOS, and Linux applications
Stars: ✭ 170 (+385.71%)
Mutual labels:  ocr, optical-character-recognition
blinkid-in-browser
BlinkID In-browser SDK for WebAssembly-enabled browsers.
Stars: ✭ 40 (+14.29%)
Mutual labels:  ocr, optical-character-recognition
Swiftocr
Fast and simple OCR library written in Swift
Stars: ✭ 4,459 (+12640%)
Mutual labels:  ocr, optical-character-recognition
Pan card ocr project
To extract details from Indian National Identification Cards such as PAN (completed) & Aadhar, Passport, Driving License (WIP) in a structured format
Stars: ✭ 39 (+11.43%)
Mutual labels:  ocr, optical-character-recognition

mirador-textoverlay

npm package required Mirador version

A Mirador 3 plugin to display a selectable text overlay based on OCR or transcriptions.

Screenshot Demo on https://mirador-textoverlay.netlify.com (try selecting some text)

Requirements for supported IIIF manifests

  • Line-level annotations with either one of:
    • a motivation that is supplementing (IIIF v3)
    • a resource that has a @type that is cnt:contentAsText (IIIF v2)
    • a dcType that is equal to Line (Europeana)
  • A per-canvas seeAlso entry pointing to the ALTO or hOCR OCR markup for the page with either:
    • A format that is application/xml+alto or text/vnd.hocr+html
    • A profile starting with http://www.loc.gov/standards/alto/, http://kba.cloud/hocr-spec, http://kba.github.io/hocr-spec/ or https://github.com/kba/hocr-spec/blob/master/hocr-spec.md
  • If using OCR markup, the plugin can handle arbitrary scaling factors, i.e. as long as the OCR matches the canvas it should render fine

For a list of example manifests that are supported, refer to the catalog entry in the demo instance configuration. If you need support for your particular flavor of attaching text to a IIIF canvas, open an issue :-)

Installation

Currently the plugin can only be used if you build your own Mirador JavaScript bundle. To include the plugin in your Mirador installation, you need to install it from npm with npm install mirador-textoverlay, import it into your project and pass it to Mirador when you instantiate the viewer:

import Mirador from 'mirador/dist/es/src/index';
import textOverlayPlugin from 'mirador-textoverlay/es';

const miradorConfig = {
  // Your Mirador configuration
}
Mirador.viewer(config, [...textOverlayPlugin]);

Configuration

You can configure the plugin globally for all windows and/or individually for every window.

For global configuration add the textOverlay entry to the top-level window configuration (globally for all windows) or to the individual window object:

const miradorConfig = {
  window: {
    // ....
    textOverlay: {
      // Global options for all windows, see available settings below
    },
  },
  windows: [{
    // ....
    textOverlay: {
      // Options for an individual window, see available settings below
    },
  }, // ...
}

You can view an example configuration in demo/src/index.js.

The available configuration options (all of which define defaults that can be changed through the UI, except for enabled and fontFamily) are:

  • enabled: If the plugin is enabled. Boolean, defaults to true.
  • selectable: Set default text selectability. Boolean, defaults to false.
  • visible: Set default text visibility. Boolean, defaults to false.
  • opacity: Default opacity of the visible text. Number between 0 and 1, defaults to 1.0
  • useAutoColors: Try to determine fitting text and background colors from the page image itself.
    Falls back to textCololor/bgColor if auto-detection fails (e.g. due to missing CORS headers).
    Boolean, defaults to true.
  • textColor: Set default text color. RGB color string, defaults to #000000 (black)
  • bgColor: Set default text background color. RGB color string, defaults to #ffffff (white)

The plugin also supports theming for a few things, these can be set under the textOverlay section for the light and/or dark theme (see Mirador 3 Theming on how to set these values):

  • overlayFont: Font(s) to use for rendering text. Any valid font-family CSS value
  • selectionTextColor: Color to use for rendering text when part of a selection. Any legal CSS color value.
  • selectionBackgroundColor: Color to use for text background when part of a selection. Any legal CSS color value.

How it works

The OCR or annotations boxes are rendered page-by-page and word-by-word into SVG images that have the same dimensions as the page it annotates. The position of these page SVGs is then synchronized to the Mirador viewport with dynamic CSS transformations. The implementation of the rendering itself is pretty straight-forward and can probably be adapted to most "deep zoom" viewers without a lot of additional effort. If you need the OCR parsing code as a separate package that you can base an implementation for your favorite viewer on, please open an issue :-)

Contributing

Found a bug? The plugin is not working with your manifest? Want a new feature? Create an issue, or if you want to take a shot at fixing it yourself, make a fork, create a pull request, we're always open to contributions :-)

For larger changes/features, it's usually wise to open an issue before starting the work, so we can discuss if it's a fit.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].