Layout Data

From Grooper Wiki
Jump to navigation Jump to search

Layout Data is information such as Lines, OMR Checkboxes, and Barcodes that is captured by certain Image Processing commands during the Recognize activity, and can later be recalled by various functions within Grooper that rely on the presence of those objects to function.

Use Cases

Examples in LayoutData.json

Once captured by the Recognize activity, Layout Data is saved as a .json file named LayoutData.json in the Grooper Repository as a companion file to the original Batch Folder or Batch Page where Recognition was performed. This file can be viewed by navigating to the Batch Folder or Batch Page object in the Node Tree viewer of Grooper Design Studio, navigating to the Advanced tab, and examining the Files for that object. Currently there are three pieces of information that can be stored in this file, though this is likely to grow over time: Lines, OMR Checkboxes, and Barcodes.

Lines

Lines listed in the LayoutData.json file are broken out into Horizontal Lines and Vertical lines. For each line, X/Y coordinates will be listed for the start and stop points, noted as "ptA" and "ptB". The X/Y coordinates are measured in inches, in relation to the top left corner of the image, which is known as point 0,0. Below is an example of a Horizontal Line in the LayoutData.json file:

 "HorizontalLines": [
   {
     {
       "X1": 0.1867,
       "X2": 8.1533,
       "Y1": 0.2233,
       "Y2": 0.2233
     }
   }
 ]


OMR Checkboxes

Each OMR checkbox identified will be stored in the LayoutData.json file with X/Y coordinates for the bounding rectangle and an IsChecked boolean flag. The X/Y coordinates denote the location of the top-left and bottom-right corners of the corresponding OMR checkbox. The IsChecked flag indicates whether the corresponding OMR checkbox is filled in (checked). Below is an example of an OMR checkbox in the LayoutData.json file:

 "OmrBoxes": [
   {
     "Bounds": {
       "X1": 1.6467,
       "X2": 1.7567,
       "Y1": 1.3533,
       "Y2": 1.4633
     },
     "IsChecked": false
   }
 ]


Barcodes

Each Barcode identified will be stored in the LayoutData.json file with information regarding the barcode type (symbology), X/Y coordinates for the bounding rectangle, check some validation flag, confidence score, orientation, and value. The BarcodeType is an integer which represents a corresponding barcode symbology. As an example, a BarcodeType of 8 indicates that this Barcode uses the Code 128 symbology. The ChecksumIsValid flag is set to True if the barcode contains a valid checksum. The Orientation indicates the read direction of the barcode. As an example, an Orientation of 1 indicates the barcode was read in East orientation. The Value is the read value from the barcode. Below is an example of a Barcode in the LayoutData.json file:

 "Barcodes": [
   {
     "BarcodeType": 8,
     "Bounds": {
       "X1": 1.8467,
       "X2": 4.5167,
       "Y1": 1.0833,
       "Y2": 1.9333
     },
     "ChecksumIsValid": false,
     "Confidence": 1,
     "Orientation": 1,
     "Value": "Dummy Value Read from Barcode"
   }
 ]