Skip to content

Processing Parameters

After adding DocumentReaderService to the global variable, you can change the default document recognition and image processing as described on this page.

Video Capture

Image recognition (video capture) default settings. The functionality is available via the camera button. See the sample configuration below.

window.RegulaDocumentSDK.recognizerProcessParam = {
  processParam: {
    returnUncroppedImage: true,
    multipageProcessing: false,
    returnPackageForReprocess: false,
    timeout: 20000,
    resultTypeOutput: [],
    imageQa: {
      expectedPass: ['dpiThreshold', 'glaresCheck', 'focusCheck'],
      dpiThreshold: 130,
      glaresCheck: true,
      glaresCheckParams: {
        imgMarginPart: 0.05,
        maxGlaringPart: 0.01,
      },
    },
  },
};

Session ID for video processing:

window.RegulaDocumentSDK.recognizerProcessParam = {
  tag: 'your session id',
};

Image Processing

Image processing default settings. The functionality is available via the gallery button. See the sample configuration below.

window.RegulaDocumentSDK.imageProcessParam = {
  processParam: {
    returnUncroppedImage: true,
    returnPackageForReprocess: false,
  },
};

Session ID for image processing:

window.RegulaDocumentSDK.imageProcessParam = {
  tag: 'your session id',
};

Parameters Description

Parameter Description Data type Default value Values
returnUncroppedImage When enabled, returns input images in output. boolean true true, false
scenario Recognition scenario. string
  • 'MrzAndLocate'
  • 'MrzOrLocate'
  • 'Mrz'
  • 'Locate'
  • 'Barcode'
  • 'MrOrBarcode'
  • 'BarcodeAndLocate'
multipageProcessing Whether to enable multi-page document processing mode. boolean true true, false
timeout Recognition timeout in milliseconds. After this time process will be finished. number 2000 numbers > 0
timeoutFromFirstDetect Start the countdown from the moment the document is detected. number 5000 numbers > 0
resultTypeOutput Types of results to return in response. [] - all available types. number[] []
  • 1 - DocumentImageResult
  • 3 - TextDataResult
  • 5 - DocBarCodeInfo
  • 6 - GraphicsResult
  • 8 - DocumentTypesCandidatesResult
  • 9 - ChosenDocumentTypeResult
  • 20 - AuthenticityResult
  • 15 - LexicalAnalysisResult
  • 17 - TextDataResult
  • 18 - TextDataResult
  • 19 - GraphicsResult
  • 30 - ImageQualityResult
  • 33 - StatusResult
  • 36 - TextResult
  • 37 - ImagesResult
  • 85 - DocumentPositionResult
  • 102 - TextDataResult
  • 103 - GraphicsResult
  • 50 - LicenseResult
  • 49 - EncryptedRCLResult
returnPackageForReprocess When enabled, returns the package for reprocessing on the backend. boolean false true, false
strictImageQuality When enabled, image quality checks status affects document optical and overall status. boolean false true, false
imageQa Image quality parameters.
imageQadpiThreshold This parameter sets threshold for Image QA check of the presented document physical dpi. If actual document dpi is below this threshold, check will fail. number 150 numbers > 0
imageQaangleThreshold This parameter sets the threshold for an actual document perspective angle above which the check fails (in degrees). number 5 numbers > 0
imageQafocusCheck When enabled, the captured image is checked for the proper focus. boolean true true, false
imageQaglaresCheck This option enables glares check while performing image quality validation. boolean true true, false
imageQaglaresCheckParams Settings for glare check. number
imageQaglaresCheckParamsimgMarginPart This parameter specifies the indent from the document image border within which the glare detection will be ignored. number 0 0 - 1
imageQaglaresCheckParamsmaxGlaringPart This parameter specifies the maximum size for glare-like objects that should not be considered as glares; only those exceeding this size will be validated. number 0 0 - 1
imageQadocumentPositionIndent This parameter sets the minimum indent (as a percentage of document width) from the corners of the document to the borders of the image. If the corners of the document are closer than the specified value, the status will contain an error in the documentPosition field. number 0 numbers >= 0
imageQabrightnessThreshold This parameters sets the threshold for an actual document brightness below which the check fails.
expectedPass Activated image quality checks. string[] ['dpiThreshold', 'glaresCheck', 'focusCheck']
  • 'dpiThreshold'
  • 'glaresCheck'
  • 'focusCheck'
imageOutputMaxHeight This parameter allows setting maximum height in pixels of output images and thus reducing image size to desired. Does not change the aspect ratio. Changes disabled if equals to 0. number 0 numbers > 0
imageOutputMaxWidth This parameter allows setting maximum width in pixels of output images and thus reducing image size to desired. Does not change the aspect ratio. Changes disabled if equals to 0. number 0 numbers > 0
dateFormat This option allows you to set dates format so that solution will return dates in this format. For example, if you supply 'MM/dd/yyyy', and document have printed date '09 JUL 2020' for the date os issue, you will get '07/09/2020' as a result. By default it is set to system locale default (where the service is running). string 'MM/dd/yyyy'
measureSystem This option allows you to set the system of measurement used for converting original values in document to output result values. Metric by default. number 0
  • 0 - Metric
  • 1 - Imperial
    imageDpiOutMax This parameter controls maximum resolution in dpi of output images. Resolution will remain original in case 0 is supplied. By default is set to return images in response with resolution not greater than 300 dpi for all scenarios except FullAuth. In FullAuth scenario this limit is 1000 dpi by default. number numbers > 0
    alreadyCropped This option can be enabled if you know for sure that the image you provide contains already cropped document by its edges. This was designed to process on the server side images captured and cropped on mobile. boolean false true, false
    generateDoublePageSpreadImage When enabled, the result contains two aligned and straighten passport pages from an input image as if it was captured from the flatbed scanner. boolean false true, false
    customParams This option allows passing custom processing parameters that can be implemented in future without changing API. Object {}
    fastDocDetect (deprecated) When enabled, shorten the list of candidates to process during document detection in a single image process mode. Reduces processing time for specific backgrounds. boolean true true, false
    updateOCRValidityByGlare When enabled, fail OCR field validity, if there is a glare over the text field on the image. boolean false true, false
    returnCroppedBarcode When enabled, returns cropped barcode images for unknown documents. boolean false true, false
    respectImageQuality When enabled, image quality checks status affects document optical and overall status. boolean false true, false
    forceDocFormat Force use of specified document format when locating and recognizing document to reduce the number of candidates. number
    • 0 - ID1 document format
    • 1 - ID2 document format
    • 2 - ID3 document format
    • 3 - Undefined document format
    • 4 - A4 document format
    • 5 - ID3 double document format
    • 10 - ID1 format document rotated 90°
    • 11 - ID1 format document rotated 180°
    • 12 - ID1 format document rotated 270°
    • 13 - ID2 format document rotated 90°
    • 14 - ID3 format document rotated 180°
    • 1000 - Arbitrary format
    • 1002 - Flexible format. Standard formats can be resized during cropping, depending on various factors: light, background, etc.
    noGraphics When enabled, no graphic fields will be cropped from document image. boolean false true, false
    documentAreaMin Specifies minimal area of the image that document should cover to be treated as candidate when locating. Value should be in range from 0 to 1, where 1 is when document should fully cover the image. number 0 0 - 1
    log When enabled, results will contain transaction processing log from the server in the form of Base64 string. boolean false true, false
    logLevel When used together with log parameter enabled, sets the level of transaction logs detalization. string Info Debug, Info, Warning, Error
    depersonalizeLog When enabled, all personal data will be forcibly removed from the logs. boolean false true, false
    multiDocOnImage This option allows locating and cropping multiple documents from one image if enabled. boolean false true, false
    shiftExpiryDate This option allows shifting the date of expiry into the future or past for number of months specified. This is useful, for example, in some cases when document might be still valid for some period after original expiration date to prevent negative validity status for such documents. Or by shifting the date to the past will set negative validity for the documents that is about to expire in a specified number of months. number 0 numbers > 0
    minimalHolderAge This options allows specifying the minimal age in years of the document holder for the document to be considered valid. number 0 numbers > 0
    mrzFormatsFilter This option allows limiting MRZ formats to be recognized by specifying them in array. string[] []
    • '1x30' - IDL
    • '3x30' - ID1
    • '2x36' - ID2
    • '2x44' - ID3
    • '1x6' - CAN
    • '2x30' - ID1 2x30
    forceReadMrzBeforeLocate When enabled, make sure that in series processing MRZ is located fully inside the result document image, if present on the document. Enabling this option may add extra processing time, by disabling optimizations, but allows more stability in output image quality. boolean false true, false
    mrzDetectMode Specify the MRZ detection mode to improve the recognition quality on complex noisy backgrounds, like black and white photocopy of some documents. Works only in the single-frame processing mode. boolean false true, false
    parseBarcodes This option can be disabled to stop parsing after barcode is read. boolean true true, false
    strictBarcodeDigitalSignatureCheck When enabled, this parameter forces the Barcode Format check failing if the certificates required for performing the Digital Signature check are missing. boolean false true, false
    selectLongestNames When enabled, select the longest value from the different value sources and write it to the value field if comparison is done successfully. The parameter applies this logic to the personal names, such as given name, surname, surname and given name, middle name, etc. boolean false true, false
    splitNames When enabled, the Surname and GivenNames fields will be divided into ft_First_Name, ft_Second_Name, ft_Third_Name, ft_Fourth_Name, ft_Last_Name fields. boolean false true, false
    backendProcessing When enabled, it prepares the processing result to be sent to the backend for re-processing. Use service.finalizePackage(); after receiving the processing results to send them to the backend. Object {} { serviceURL: 'URL', httpHeaders: { key1: 'header1', key2: 'header2', ... } }
    generateNumericCodes This parameter is used to generate numeric representation for issuing state and nationality codes. boolean true, false

    Warning

    If the multipage-processing or internal-scenario attributes are set, the corresponding multipageProcessing and scenario parameters' values are ignored.

    Next Steps