# Layout configuration

Refer [Layout specification](/learn/specifications/layout-specification.md)

1. Capture the printed layout using saral app for tagging.

   1. > Set debug option to true to store the image in android mobile. Modify below java file under /saralsdk and change below highlighted flags to true.

   SaralSDKOpenCVScannerActivity.java

   > > ```
   > >    mTableCornerDetection           = new TableCornerCirclesDetection(true);
   > >    mDetectShaded                   = new DetectShaded(true);
   > > ```

   2. > With the above changes, run the scan on the mobile.
   3. > Use the below command to grab the android level logs and search for 'SrlSDK::CVOps: Saving file:' and 'SrlSDK::DetectShaded: Saving file:'. This will give you path to where the saved images are stored in your android phone.

   `adb logcat`

   4. > Use the below command to pull the images finally. `adb pull <image path in android phone found in above logs>` example: `adb pull /storage/emulated/0/Android/data/com.saralapp/files/Download/table_4Fg.jpg`

2\. Tools like [MS VoTT](https://github.com/microsoft/VoTT) can be used to tag ROIs with the layout. This will give a raw VoTT Json with ROI coordinates.

3\. Use [Jupyter Notebook](https://jupyter.org) to transform raw VoTT Json to target [Layout specification](/learn/specifications/layout-specification.md) json format. Existing layout transformation notebooks can be referred @ `/specs/v1.5/jupyter-notebook` in[ ](/engage/source-code-repository.md)the [Repository](/engage/source-code-repository.md).

4\. This final layout json should be configured in backend `GET /roi/{examId}` API for each exam to enable the layout.

Starting from `v1.5.0` release each layout can have threshold minimum width,minimum height and detectionRadius configured. This configuration is used by App to detect the sheet only if minimum width and height between dark corner circles is met with scanned sheet/layout. This is to avoid invalid scans which may result in unwanted predictions.

Sample layout with threshould minWidth, minHeight and radius(radius of 4 corner dark circles for alignment) configuration.

`threshold\experimentalOMRDetection` flag is used to enable experimental feature to detection OMR filled with pencil or any color pen. This experimental feature will be available from v1.5.6 release or above.

```
  "layout": {
      "version": "1.0",
      "name": "HINDI8S13QOMR Exam Sheet Form",
      "threshold": {
          "minWidth" : 500,
          "minHeight": 200,
          "detectionRadius": 12,
          "experimentalOMRDetection": true
      },            
      "cells": [
          {
              "cellId": "1",
              "rois": [
                  {
                      "annotationTags": "ROLLNUMBERID1_1",
                      "extractionMethod": "NUMERIC_CLASSIFICATION",
                      "roiId": "1",
                      "index": 0,
                      "rect": {
                          "top": 151,
                          "left": 54,
                          "bottom": 178,
                          "right": 69
                      }
                  },
```

**Extraction Methods Supported**

<table><thead><tr><th width="402">extractionMethod</th><th>Description</th></tr></thead><tbody><tr><td><strong>NUMERIC_CLASSIFICATION</strong></td><td>This extraction method is used for handwritten digits 0 to 9.</td></tr><tr><td><strong>CELL_OMR</strong></td><td>This extraction method is used for omr detection. Added <code>experimentalOMRDetection</code>flag to support OMR filled with pencil,any color ball pens.</td></tr><tr><td><strong>BLOCK_ALPHANUMERIC_CLASSIFICATION</strong></td><td>This extraction method is used for Alphanumeric detection . For example Address filed can hold block letters with digits. This feature is available from v1.5.6 release and above.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://saral.sunbird.org/use/layout-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
