PAGE XML format collection for document image page content and more

Overview

PAGE-XML

PAGE XML format collection for document image page content and more

For an introduction, please see the following publication: http://www.primaresearch.org/publications/ICPR2010_Pletschacher_PAGE

The most actively used XML formats are:

  • PAGE XML for page content (regions, text lines, words, glyphs, reading order, text content, ...)
  • PAGE XML for layout analysis evaluation (evaluation profiles, evaluation results, ...)
  • PAGE XML for document image dewarping (dewarping grids)

All formats are defined by an XML schema, hosted officially on primaresearch.org: http://www.primaresearch.org/schema/PAGE/gts/pagecontent/2019-07-15/pagecontent.xsd http://www.primaresearch.org/schema/PAGE/eval/layout/2013-07-15/layouteval.xsd http://www.primaresearch.org/schema/PAGE/gts/dewarping/2014-08-26/dewarping.xsd

Please see the wiki for more information.

Note: The master branch contains the proposed changes for the next release.

Page Content

Proposed media type for page content: "application/vnd.prima.page+xml"

Comments
  • Using “official” Exif schema as an alternative of extended image metadata?

    Using “official” Exif schema as an alternative of extended image metadata?

    After playing around with the extended PAGE image metadata fields, @Boenig and I wanted to suggest further additions. However, this would ultimately lead to an inclusion of a complete image metadata set into PAGE which might not be desirable. Relying on an already existing XML schema is probably an effective alternative. Luckily, such a schema is existing and, even better, it is maintained under the tutelage of the W3C: https://www.w3.org/2003/12/exif/

    So, what do @chris1010010, @splet and @cneud think about simply including this rdf schema in PAGE XML?

    opened by wrznr 7
  • add semantics to coordinate system

    add semantics to coordinate system

    Coordinates are at the heart of stand-off annotation formats. In PAGE-XML, all visible elements must have a CoordsType, which must have a @points. There is even some syntax for that enforced by a regular expression. However, the standard lacks any semantics for the coordinate system whatsoever. There is not even a comment about this, so with luck, at least all implementors guessed consistently.

    IMO we need to specify that:

    1. @points always describes (a list of x-y pairs of) absolute pixel coordinates ("absolute" meaning they refer to the root image in PageType/@imageFilename with the upper left corner as 0,0)

    Moreover, we should clarify whether:

    1. @points has a topology of
      • (unordered) sets of points, or
      • a single (open or closed) path, or
      • multiple closed paths (and if so, whether orientation is relevant as in e.g. left=inside / right=outside)
    2. @points must obey certain constraints like
      • are paths allowed to leave the parent element's polygon outline / bounding box, or maybe even the page's bounding box (i.e. become negative, which is currently forbidden by syntax)? And if not:
      • must they be closed along the parent element's polygon outline / bounding box, or may they stay open when intersecting it?
      • are paths required to be planar (i.e. have no cross-sections)? And if not:
      • how does the content area compute,
        • by union, or
        • by difference, or
        • by orientation (left-of-path or right-of-path)?

    This is highly relevant for implementors, especially when polygon processing and AlternativeImage processing on multiple hierarchy levels in the presence of skew becomes common practise – which is currently happening within OCR-D (for showcases see our Tesseract and our Ocropy preprocessing and segmentation wrappers).

    (Cf. altoxml/schema#49)

    opened by bertsky 4
  • pagecontent: allow region recursion for Map, too

    pagecontent: allow region recursion for Map, too

    Add MapRegion to the xsd:choice list within RegionType (as in PageType, and as all the other region types).

    (I don't see a reason why this should be excluded – most likely just forgotten.)

    opened by bertsky 2
  • element TextStyle inside element Page

    element TextStyle inside element Page

    Hi, Sometimes it is necessary to define the Text Style (font...) for the whole page. For example if you want to create GroundTruth only for used fonts independent from text, word and glyph regions. Therefore my suggestion is to allow the element TextStyle within element Page.

    opened by tboenig 2
  • Deploy 2018 schema

    Deploy 2018 schema

    We use the 2018 version in @OCR-D for Ground Truth and expect software partners to produce PAGE based on the 2018 version.

    It would help a lot interoperability-wise if the schema location was dereferenceable, i.e. if

    http://www.primaresearch.org/schema/PAGE/gts/pagecontent/2018-07-15/pagecontent.xsd
    

    would resolve to the XSD the same way that

    http://www.primaresearch.org/schema/PAGE/gts/pagecontent/2017-07-15/pagecontent.xsd
    

    does now.

    @chris1010010 Can you create the folder and upload the XSD?

    Thank you!

    opened by kba 2
  • How can I represent the skew angle on page level?

    How can I represent the skew angle on page level?

    While it's pretty neat that I can represent skew on region level, deskewing is typically (i.e. in ABBYY products) a process which is applied on page level only. How can I incorporate skew angles on page level in PAGE XML?

    opened by wrznr 1
  • AlternativeImage for regions, lines, words and glyphs

    AlternativeImage for regions, lines, words and glyphs

    For OCR-D we have the requirement to allow preprocessing not just on page level but on regions, text lines or words. For example, dewarping of individual text blocks or text lines.

    In order to support these use cases, we extended the schema to allow pc:AlternativeImage as an optional first element within

    • RegionType
    • TextLineType
    • WordType
    • GlyphType

    Would you consider to incorporate these extensions in the next PAGE release?

    Thanks!

    CC @wrznr @tboenig @cneud

    opened by kba 1
  • Additional attributes for expressing more details on the image

    Additional attributes for expressing more details on the image

    We are currently setting up the OCR-D framework using PAGE XML. For the image pre-processing step, we'd like to propose a few additions to the image metadata header section. It would be great if they could be integrated into the “official” PAGE XML schema as well.

    opened by Boenig 1
  • clarification on reading order sorting...

    clarification on reading order sorting...

    • require @index to be ascending monotonically (but still across types)

    follow-up on https://github.com/PRImA-Research-Lab/prima-page-viewer/issues/15#issuecomment-623605873

    opened by bertsky 0
  • Clarify correct reading order index sorting

    Clarify correct reading order index sorting

    as a follow-up on https://github.com/PRImA-Research-Lab/prima-page-viewer/issues/15#issuecomment-623492135

    If @index is not required to be contiguous (which I would be happier with), please let me know.

    opened by bertsky 0
  • using this tool

    using this tool

    @kba @stweil @splet @chris1010010 @Boenig Hello! thanks a lot for this great tool! Please how can I use this tool?How can I install it ?Wha kind of command can use?

    opened by Tailor2019 5
  • missing @production / @secondaryLanguage

    missing @production / @secondaryLanguage

    Is there a reason that

    • there is no @production in PageType (and only there)
    • there is no @secondaryLanguage in TextLineType (and only there)

    or have they been forgotten?

    opened by bertsky 1
  • add Page/@comments

    add Page/@comments

    In light of #25 and general consistency, I think there should also be a @comments under PageType (as with all other segment hierarchy types). This is especially useful for descriptors of the @imageFilename (in analogy to AlternativeImage/@comments).

    opened by bertsky 0
  • standard/norm for LanguageSimpleType

    standard/norm for LanguageSimpleType

    In PAGE-XML there's @language / @primaryLanguage of type pc:LanguageSimpleType to identify the natural language of segments. Its documentation refers to ISO 639.x 2016-07-14, which I cannot make sense of. There's 639-1, 639-2 and 639-3, but AFAICT no standard that allows strings of arbitrary length (as in the PAGE-XML enumeration), and nothing shows up for 2016-07-14. This is problematic because exact 639 mappings are needed for software implementation and interoperability.

    Take Norwegian for example:

                           <enumeration value="Norwegian"/>
                            <enumeration value="Norwegian Bokmål"/>
                            <enumeration value="Norwegian Nynorsk"/>
    

    According to 639 these could be named no/nb/nn or nor/nob/nno, but how do we map that automatically, where do the strings derive from in PAGE-XML?

    opened by bertsky 4
  • Semantics of textLineOrder and readingDirection

    Semantics of textLineOrder and readingDirection

    The schema documentation only says this:

    • readingDirection:

      The direction in which text within lines should be read (order of words and characters), in addition to “textLineOrder”.

    • textLineOrder:

      The order of text lines within the block, in addition to “readingDirection”.

    Now, the values for both of these are stated in absolute terms (top-to-bottom, bottom-to-top, left-to-right, right-to-left), not relative to XML ordering (straight vs inverse).

    So how exactly should they be interpreted?

    1. W.r.t. @orientation: Before or after rotation?
    2. W.r.t. XML ordering: Should elements always be "in order" already, or must they follow some absolute top-down left-right default?
    3. W.r.t. each other: Is it an error if they are not orthogonal?

    I have not found a single example anywhere in the repo. I found but 2 examples of @readingDirection="bottom-to-top" in the PRImA Layout Analysis Dataset, namely r13 in 00000408 and r3 in 00000394 – both of which are cases of @orientation=-90°. Is this correct?

    opened by bertsky 3
  • support scale attribute for down/upsampled images

    support scale attribute for down/upsampled images

    Since AlternativeImage has been introduced on every level of the structural hierarchy, these image files can be used to represent results from image preprocessing (normalization, denoising, binarization, non-text suppression, despeckling, deskewing, dewarping). Some of these operations can and some cannot be represented descriptively – but referencing derived images always helps avoiding repeated computations.

    However, there's a difficulty/penalty involved: All coordinates in the PAGE hierarchy are referring to the original image (under /PcGts/Page/@imageFilename), whereas derived images (AlternativeImage/@filename under Page or Region or TextLine or Word) necessarily have different, local/relative coordinate system. It is connected to the global/absolute coordinate system only implicitly.

    So if you want to process via derived images, like crop segments further down the hierarchy (translating from their absolute coordinates to the images' relative coordinates) or add further segmentation (translating from new relative coordinates in the images to new absolute coordinates), then you must know the transformation between them.

    This could merely be an offset (which could be unambiguously defined as the top left of the bounding box of the element's polygon), which happens after cropping (on the page level or any segmentation below that). But there are certain operations which change coordinates non-trivially:

    • Deskewing will shift to the center of the element's bounding box, then rotate around that center, increasing the size of the bounding box (to avoid loosing content at the corners), and shifting back to the (new) top left of the bounding box. Alternatively, larger angles (e.g. multiples of 90°) could be applied by reflection instead of rotation.
    • Dewarping may change coordinates in any number of ways (3d shear or cubic spline projection, or interpolated raster grid, including as a special case centerline projection).
    • Rescaling or aspect correction will multiply coordinates by a constant factor.

    All those effects are cumulative, i.e. they will compose into a new coordinate transform at each step, and in the order of the operations applied to the image (and its predecessors). This is not always trivial, e.g. cropping before/after deskewing, deskewing on page and then again on region level. It's certainly not rocket science, but (believe me) there are many ways you can get this wrong when you have to implement it.

    Now, for cropping and deskewing, we are in the fortunate situation that – provided the operations applied on the derived image have been carried out in the "correct" way and documented in its @comments – their respective coordinate transform can be reconstructed from the descriptive information (Coords/@points and @orientation).

    But for dewarping and rescaling we don't even have any descriptive annotation yet.

    For dewarping, maybe the dewarping schema with its /DwGts/Grid/Row/@points is sufficient (although it is unfortunate that this schema is external to the content schema).

    But for rescaling, there's nothing at all.

    You could ask:

    1. shouldn't we then allow annotating the coordinate transform explicitly?
    2. why do you want to rescale?

    1: I'd be happy to see PAGE adopt some representation of affine transformations (basically a 3x3 float array) under AlternativeImage/@coordinate-system. But I would still consider this only a redundant convenience feature.

    2: Rescaling is useful under various scenarios:

    • avoid wasting computation on images with too large pixel density by downsampling them during processing
    • ensuring a fixed pixel density for operations that expect certain component sizes or distances (e.g. rule-based segmentation tools always assuming 300 DPI)
    • ensuring a fixed pixel resolution for operations that expect a certain image size (e.g. neural segmentation tools)
    • ensuring a fixed width/height aspect ratio during processing

    Thus, I propose to at least introduce a descriptive annotation for derived images' scale factors:

    • AlternativeImage/@imageWidth (as in Page/@imageWidth)
    • AlternativeImage/@imageHeight (as in Page/@imageHeight)
    • AlternativeImage/@imageXResolution (as in Page/@imageXResolution)
    • AlternativeImage/@imageYResolution (as in Page/@imageYResolution)
    • AlternativeImage/@imageResolutionUnit (as in Page/@imageResolutionUnit)
    • AlternativeImage/@imageXScale (how much is AlternativeImage/@imageXResolution zoomed over Page/@imageXResolution?)
    • AlternativeImage/@imageYScale (how much is AlternativeImage/@imageYResolution zoomed over Page/@imageYResolution?)

    (Of course, the latter 2 are redundant, but pixel density might not be known exactly/reliably and thus omitted / set to zero. In that case, the scale can still describe precisely the factor between the unknown density of the original image and the unknown density of the derived image.)

    opened by bertsky 4
Releases(2019-07-15_2)
Owner
PRImA Research Lab
Pattern Recognition and Image Analysis Research Lab
PRImA Research Lab
Steve Tu 71 Dec 30, 2022
🖺 OCR using tensorflow with attention

tensorflow-ocr 🖺 OCR using tensorflow with attention, batteries included Installation git clone --recursive http://github.com/pannous/tensorflow-ocr

646 Nov 11, 2022
A bot that plays TFT using OCR. Keeps track of bench, board, items, and plays the user defined team comp.

NOTES: To ensure best results, make sure you are running this on a computer that has decent specs. 1920x1080 fullscreen is required in League, game mu

francis 125 Dec 30, 2022
This is the code for our paper DAAIN: Detection of Anomalous and AdversarialInput using Normalizing Flows

Merantix-Labs: DAAIN This is the code for our paper DAAIN: Detection of Anomalous and Adversarial Input using Normalizing Flows which can be found at

Merantix 14 Oct 12, 2022
caffe re-implementation of R2CNN: Rotational Region CNN for Orientation Robust Scene Text Detection

R2CNN: Rotational Region CNN for Orientation Robust Scene Text Detection Abstract This is a caffe re-implementation of R2CNN: Rotational Region CNN fo

candler 80 Dec 28, 2021
Scale-aware Automatic Augmentation for Object Detection (CVPR 2021)

SA-AutoAug Scale-aware Automatic Augmentation for Object Detection Yukang Chen, Yanwei Li, Tao Kong, Lu Qi, Ruihang Chu, Lei Li, Jiaya Jia [Paper] [Bi

Jia Research Lab 182 Dec 29, 2022
[EMNLP 2021] Improving and Simplifying Pattern Exploiting Training

ADAPET This repository contains the official code for the paper: "Improving and Simplifying Pattern Exploiting Training". The model improves and simpl

Rakesh R Menon 138 Dec 26, 2022
CRAFT-Pyotorch:Character Region Awareness for Text Detection Reimplementation for Pytorch

CRAFT-Reimplementation Note:If you have any problems, please comment. Or you can join us weChat group. The QR code will update in issues #49 . Reimple

453 Dec 28, 2022
基于openpose和图像分类的手语识别项目

手语识别 0、使用到的模型 (1). openpose,作者:CMU-Perceptual-Computing-Lab https://github.com/CMU-Perceptual-Computing-Lab/openpose (2). 图像分类classification,作者:Bubbl

20 Dec 15, 2022
TextBoxes: A Fast Text Detector with a Single Deep Neural Network https://github.com/MhLiao/TextBoxes 基于SSD改进的文本检测算法,textBoxes_note记录了之前整理的笔记。

TextBoxes: A Fast Text Detector with a Single Deep Neural Network Introduction This paper presents an end-to-end trainable fast scene text detector, n

zhangjing1 24 Apr 28, 2022
A small C++ implementation of LSTM networks, focused on OCR.

clstm CLSTM is an implementation of the LSTM recurrent neural network model in C++, using the Eigen library for numerical computations. Status and sco

Tom 794 Dec 30, 2022
Text-to-Image generation

Generate vivid Images for Any (Chinese) text CogView is a pretrained (4B-param) transformer for text-to-image generation in general domain. Read our p

THUDM 1.3k Jan 05, 2023
aardio的opencv库

opencv_aardio dll库下载地址:https://github.com/xuncv/opencv-plugin/releases import cv2 img = cv2.imread("./images/Lena.jpg",1) img = cv2.medianBlur(img,5)

71 Dec 31, 2022
Scene text detection and recognition based on Extremal Region(ER)

Scene text recognition A real-time scene text recognition algorithm. Our system is able to recognize text in unconstrain background. This algorithm is

HSIEH, YI CHIA 155 Dec 06, 2022
Repositório para registro de estudo da biblioteca opencv (Python)

OpenCV (Python) Objetivo do Repositório: Registrar avanços no estudo da biblioteca opencv. O repositório estará aberto a qualquer pessoa e há tambem u

1 Jun 14, 2022
A general list of resources to image text localization and recognition 场景文本位置感知与识别的论文资源与实现合集 シーンテキストの位置認識と識別のための論文リソースの要約

Scene Text Localization & Recognition Resources Read this institute-wise: English, 简体中文. Read this year-wise: English, 简体中文. Tags: [STL] (Scene Text L

Karl Lok (Zhaokai Luo) 901 Dec 11, 2022
An OCR evaluation tool

dinglehopper dinglehopper is an OCR evaluation tool and reads ALTO, PAGE and text files. It compares a ground truth (GT) document page with a OCR resu

QURATOR-SPK 40 Dec 20, 2022
[python3.6] 运用tf实现自然场景文字检测,keras/pytorch实现ctpn+crnn+ctc实现不定长场景文字OCR识别

本文基于tensorflow、keras/pytorch实现对自然场景的文字检测及端到端的OCR中文文字识别 update20190706 为解决本项目中对数学公式预测的准确性,做了其他的改进和尝试,效果还不错,https://github.com/xiaofengShi/Image2Katex 希

xiaofeng 2.7k Dec 25, 2022
A set of workflows for corpus building through OCR, post-correction and normalisation

PICCL: Philosophical Integrator of Computational and Corpus Libraries PICCL offers a workflow for corpus building and builds on a variety of tools. Th

Language Machines 41 Dec 27, 2022