Skip to content

Image Quality

  • When enabled, the image quality check status affects the document optical and overall status:
DocReader.shared.processParams.respectImageQuality = true
RGLDocReader.shared.processParams.respectImageQuality = @YES;
DocumentReader.Instance().processParams().respectImageQuality = true
DocumentReader.Instance().processParams().respectImageQuality = true;
DocumentReader.instance.processParams.respectImageQuality = true;
DocumentReader.setProcessParams({
  respectImageQuality: true
}, _ => { }, _ => { });
DocumentReader.setProcessParams({
    respectImageQuality: true
});
DocumentReader.setProcessParams({
    respectImageQuality: true
}, function (m) { }, function (e) { });
// Android
DocumentReader.Instance().ProcessParams().RespectImageQuality = (Java.Lang.Boolean)true;

// iOS
RGLDocReader.Shared.ProcessParams.RespectImageQuality = true;
  • Set the threshold for an actual document DPI below which the check fails:
DocReader.shared.processParams.imageQA.dpiThreshold = 150
RGLDocReader.shared.processParams.imageQA.dpiThreshold = @150;
DocumentReader.Instance().processParams().imageQA.dpiThreshold = 150
DocumentReader.Instance().processParams().imageQA.dpiThreshold = 150;
DocumentReader.instance.processParams.imageQA.dpiThreshold = 150;
DocumentReader.setProcessParams({
    imageQA: {
        dpiThreshold: 150
    }
}, (str) => { console.log(str) }, (error) => { console.log(error) });
DocumentReader.setProcessParams({
    imageQA: {
        dpiThreshold: 150
    }
});
DocumentReader.setProcessParams({
    imageQA: {
          dpiThreshold: 150
    }
}, function (m) { }, function (e) { console.log(e); });
// Android
DocumentReader.Instance().ProcessParams().ImageQA.DpiThreshold = (Java.Lang.Integer)150;

// iOS
```csharp
RGLDocReader.Shared.ProcessParams.ImageQA.DpiThreshold = 150;
  • Set the threshold for an actual document perspective angle above which the check fails:
DocReader.shared.processParams.imageQA.angleThreshold = 5
RGLDocReader.shared.processParams.imageQA.angleThreshold = @5;
DocumentReader.Instance().processParams().imageQA.angleThreshold = 5
DocumentReader.Instance().processParams().imageQA.angleThreshold = 5;
DocumentReader.instance.processParams.imageQA.angleThreshold = 5;
DocumentReader.setProcessParams({
    imageQA: {
        angleThreshold: 5
    }
}, (str) => { console.log(str) }, (error) => { console.log(error) });
DocumentReader.setProcessParams({
    imageQA: {
        angleThreshold: 5
    }
});
DocumentReader.setProcessParams({
    imageQA: {
          angleThreshold: 5
    }
}, function (m) { }, function (e) { console.log(e); });
// Android
DocumentReader.Instance().ProcessParams().ImageQA.AngleThreshold = (Java.Lang.Integer)5;

// iOS
```csharp
RGLDocReader.Shared.ProcessParams.ImageQA.AngleThreshold = 5;
  • Disable / enable the focus check for the image quality validation:
DocReader.shared.processParams.imageQA.focusCheck = true
RGLDocReader.shared.processParams.imageQA.focusCheck = @YES;
DocumentReader.Instance().processParams().imageQA.focusCheck = true
DocumentReader.Instance().processParams().imageQA.focusCheck = true;
DocumentReader.instance.processParams.imageQA.focusCheck = true;
DocumentReader.setProcessParams({
    imageQA: {
        focusCheck: true
    }
}, (str) => { console.log(str) }, (error) => { console.log(error) });
DocumentReader.setProcessParams({
    imageQA: {
        focusCheck: true
    }
}, function (m) { }, function (e) { console.log(e); });
DocumentReader.setProcessParams({
    imageQA: {
          focusCheck: true
    }
}, function (m) { }, function (e) { console.log(e); });
// Android
DocumentReader.Instance().ProcessParams().ImageQA.FocusCheck = (Java.Lang.Boolean)true;

// iOS
```csharp
RGLDocReader.Shared.ProcessParams.ImageQA.FocusCheck = true;
  • Disable / enable the glares check for the image quality validation:
DocReader.shared.processParams.imageQA.glaresCheck = true
RGLDocReader.shared.processParams.imageQA.glaresCheck = @YES;
DocumentReader.Instance().processParams().imageQA.glaresCheck = true
DocumentReader.Instance().processParams().imageQA.glaresCheck = true;
DocumentReader.instance.processParams.imageQA.glaresCheck = true;
DocumentReader.setProcessParams({
    imageQA: {
        glaresCheck: true
    }
}, (str) => { console.log(str) }, (error) => { console.log(error) });
DocumentReader.setProcessParams({
    imageQA: {
        glaresCheck: true
    }
}, function (m) { }, function (e) { console.log(e); });
DocumentReader.setProcessParams({
    imageQA: {
          glaresCheck: true
    }
}, function (m) { }, function (e) { console.log(e); });
// Android
DocumentReader.Instance().ProcessParams().ImageQA.GlaresCheck = (Java.Lang.Boolean)true;

// iOS
```csharp
RGLDocReader.Shared.ProcessParams.ImageQA.GlaresCheck = true;
  • In case the glares check is enabled, you can specify the indent from the document image border within which the glare detection will be ignored:
DocReader.shared.processParams.imageQA.glaresCheck = true
DocReader.shared.processParams.imageQA.glaresCheckParams.imgMarginPart = 0.05
RGLDocReader.shared.processParams.imageQA.glaresCheck = @YES;
RGLDocReader.shared.processParams.imageQA.glaresCheckParams.imgMarginPart = @0.05;
DocumentReader.Instance().processParams().imageQA.glaresCheck = true
DocumentReader.Instance().processParams().imageQA.glaresCheckParams.imgMarginPart = 0.05
DocumentReader.Instance().processParams().imageQA.glaresCheck = true;
DocumentReader.Instance().processParams().imageQA.glaresCheckParams.imgMarginPart = 0.05;
DocumentReader.instance.processParams.imageQA.glaresCheck = true;
DocumentReader.instance.processParams.imageQA.glaresCheckParams.imgMarginPart = 0.05;
DocumentReader.setProcessParams({
    imageQA: {
        glaresCheck: true,
        glaresCheckParams: {
          imgMarginPart: 0.05
        },
    }
}, (str) => { console.log(str) }, (error) => { console.log(error) });
DocumentReader.setProcessParams({
    imageQA: {
        glaresCheck: true,
        glaresCheckParams: {
          imgMarginPart: 0.05
        },
    }
});
DocumentReader.setProcessParams({
    imageQA: {
        glaresCheck: true,
        glaresCheckParams: {
          imgMarginPart: 0.05
        },
    }
}, function (m) { }, function (e) { console.log(e); });
// Android
DocumentReader.Instance().ProcessParams().ImageQA.GlaresCheck = (Java.Lang.Boolean)true;
DocumentReader.Instance().ProcessParams().ImageQA.GlaresCheckParams.ImgMarginPart = (Java.Lang.Double)0.05;

// iOS
RGLDocReader.Shared.ProcessParams.ImageQA.GlaresCheck = true;
RGLDocReader.Shared.ProcessParams.ImageQA.GlaresCheckParams.ImgMarginPart = 0.05;
  • In case the glares check is enabled, you can specify the maximum size for glare-like objects that should not be considered as glares; only those exceeding this size will be validated:
DocReader.shared.processParams.imageQA.glaresCheck = true
DocReader.shared.processParams.imageQA.glaresCheckParams.maxGlaringPart = 0.01
RGLDocReader.shared.processParams.imageQA.glaresCheck = @YES;
RGLDocReader.shared.processParams.imageQA.glaresCheckParams.maxGlaringPart = @0.01;
DocumentReader.Instance().processParams().imageQA.glaresCheck = true
DocumentReader.Instance().processParams().imageQA.glaresCheckParams.maxGlaringPart = 0.01
DocumentReader.Instance().processParams().imageQA.glaresCheck = true;
DocumentReader.Instance().processParams().imageQA.glaresCheckParams.maxGlaringPart = 0.01;
DocumentReader.instance.processParams.imageQA.glaresCheck = true;
DocumentReader.instance.processParams.imageQA.glaresCheckParams.maxGlaringPart = 0.01;
DocumentReader.setProcessParams({
    imageQA: {
        glaresCheck: true,
        glaresCheckParams: {
          maxGlaringPart: 0.01
        },
    }
}, (str) => { console.log(str) }, (error) => { console.log(error) });
DocumentReader.setProcessParams({
    imageQA: {
        glaresCheck: true,
        glaresCheckParams: {
          maxGlaringPart: 0.01
        },
    }
});
DocumentReader.setProcessParams({
    imageQA: {
        glaresCheck: true,
        glaresCheckParams: {
          maxGlaringPart: 0.01
        },
    }
}, function (m) { }, function (e) { console.log(e); });
// Android
DocumentReader.Instance().ProcessParams().ImageQA.GlaresCheck = (Java.Lang.Boolean)true;
DocumentReader.Instance().ProcessParams().ImageQA.GlaresCheckParams.MaxGlaringPart = (Java.Lang.Double)0.01;

// iOS
RGLDocReader.Shared.ProcessParams.ImageQA.GlaresCheck = true;
RGLDocReader.Shared.ProcessParams.ImageQA.GlaresCheckParams.MaxGlaringPart = 0.01;
  • Disable / enable the colorness check for the image quality validation:
DocReader.shared.processParams.imageQA.colornessCheck = true
RGLDocReader.shared.processParams.imageQA.colornessCheck = @YES;
DocumentReader.Instance().processParams().imageQA.colornessCheck = true
DocumentReader.Instance().processParams().imageQA.colornessCheck = true;
DocumentReader.instance.processParams.imageQA.colornessCheck = true;
DocumentReader.setProcessParams({
    imageQA: {
        colornessCheck: true
    }
}, (str) => { console.log(str) }, (error) => { console.log(error) });
DocumentReader.setProcessParams({
    imageQA: {
        colornessCheck: true
    }
}, function (m) { }, function (e) { console.log(e); });
DocumentReader.setProcessParams({
    imageQA: {
          colornessCheck: true
    }
}, function (m) { }, function (e) { console.log(e); });
// Android
DocumentReader.Instance().ProcessParams().ImageQA.ColornessCheck = (Java.Lang.Boolean)true;

// iOS
```csharp
RGLDocReader.Shared.ProcessParams.ImageQA.ColornessCheck = true;
  • Set the threshold for an actual document brightness below which the check fails:
DocReader.shared.processParams.imageQA.brightnessThreshold = 1.5
RGLDocReader.shared.processParams.imageQA.brightnessThreshold = @1.5;
DocumentReader.Instance().processParams().imageQA.brightnessThreshold = 1.5
DocumentReader.Instance().processParams().imageQA.brightnessThreshold = 1.5;
DocumentReader.instance.processParams.imageQA.brightnessThreshold = 1.5;
DocumentReader.setProcessParams({
    imageQA: {
        brightnessThreshold: 1.5
    }
}, (str) => { console.log(str) }, (error) => { console.log(error) });
DocumentReader.setProcessParams({
    imageQA: {
        brightnessThreshold: 1.5
    }
});
DocumentReader.setProcessParams({
    imageQA: {
          brightnessThreshold: 1.5
    }
}, function (m) { }, function (e) { console.log(e); });
// Android
DocumentReader.Instance().ProcessParams().ImageQA.BrightnessThreshold = (Java.Lang.Double)1.5;

// iOS
```csharp
RGLDocReader.Shared.ProcessParams.ImageQA.BrightnessThreshold = 1.5;
  • This option controls the quality checks that the image should pass to be considered a valid input during the scanning process.
DocReader.shared.processParams.imageQA.expectedPass = [.imageResolution, .imageGlares]
RGLDocReader.shared.processParams.imageQA.expectedPass = @[RGLImageQualityCheckTypeImageResolution, RGLImageQualityCheckTypeImageGlares];
DocumentReader.Instance().processParams().imageQA!!.expectedPass = intArrayOf(
        eImageQualityCheckType.IQC_IMAGE_RESOLUTION,
        eImageQualityCheckType.IQC_IMAGE_GLARES
    )
DocumentReader.Instance().processParams().imageQA.expectedPass = new int[] {eImageQualityCheckType.IQC_IMAGE_RESOLUTION, eImageQualityCheckType.IQC_IMAGE_GLARES};
DocumentReader.instance.processParams.imageQA.expectedPass = [
  ImageQualityCheckType.IMAGE_RESOLUTION,
  ImageQualityCheckType.IMAGE_GLARES
];
DocumentReader.setProcessParams({
    imageQA: {
        expectedPass: [
            eImageQualityCheckType.IQC_IMAGE_RESOLUTION,
            eImageQualityCheckType.IQC_IMAGE_GLARES
        ]
    }
}, (str) => { console.log(str) }, (error) => { console.log(error) });
DocumentReader.setProcessParams({
    imageQA: {
        expectedPass: [
            eImageQualityCheckType.IQC_IMAGE_RESOLUTION,
            eImageQualityCheckType.IQC_IMAGE_GLARES
          ]
    }
}, function (m) { }, function (e) { console.log(e); });
DocumentReader.setProcessParams({
    imageQA: {
        expectedPass: [
            eImageQualityCheckType.IQC_IMAGE_RESOLUTION,
            eImageQualityCheckType.IQC_IMAGE_GLARES
        ]
    }
}, function (m) { }, function (e) { console.log(e); });
// Android
DocumentReader.Instance().ProcessParams().ImageQA.ExpectedPass = new int[] { EImageQualityCheckType.IqcImageResolution, EImageQualityCheckType.IqcImageGlares};

// iOS
```csharp
RGLDocReader.Shared.ProcessParams.ImageQA.ExpectedPass = { Constants.RGLImageQualityCheckTypeImageGlares, Constants.RGLImageQualityCheckTypeImageColorness };
  • Specify the minimum indent from the corners of the document to the borders of the image. The value reflects the allowed percentage for the indent relative to the width of the document. If it is detected that the corners of the document are closer than the specified value, the status will contain an error in the documentPosition field.
DocReader.shared.processParams.imageQA.documentPositionIndent = 5
RGLDocReader.shared.processParams.imageQA.documentPositionIndent = @5;    
DocumentReader.Instance().processParams().imageQA.documentPositionIndent = 5
DocumentReader.Instance().processParams().imageQA.documentPositionIndent = 5;
DocumentReader.instance.processParams.imageQA.documentPositionIndent = 5;
DocumentReader.setProcessParams({
    imageQA: {
        documentPositionIndent: 5
    }
}, (str) => { console.log(str) }, (error) => { console.log(error) });
DocumentReader.setProcessParams({
    imageQA: {
        documentPositionIndent: 5
    }
});
DocumentReader.setProcessParams({
    imageQA: {
          documentPositionIndent: 5
    }
}, function (m) { }, function (e) { console.log(e); });
// Android
DocumentReader.Instance().ProcessParams().ImageQA.DocumentPositionIndent = (Java.Lang.Integer)5;

// iOS
```csharp
RGLDocReader.Shared.ProcessParams.ImageQA.DocumentPositionIndent = 5;

Next Steps