Setting Configurations, Error messages, Camera customization

The following methods are commonly used to set up configurations, error messages, scanning title messages, and camera customization

Methods use to set configs are as follows

      AccuraOcr.setFaceBlurPercentage(80);
      AccuraOcr.setHologramDetection(true);
      AccuraOcr.setLowLightTolerance(10);
      AccuraOcr.setMotionThreshold(25);
      AccuraOcr.setMinGlarePercentage(6);
      AccuraOcr.setMaxGlarePercentage(99);
      AccuraOcr.setBlurPercentage(60);
      AccuraOcr.setCameraFacing(0);
      AccuraOcr.EnableLogs(false);

Methods use to set Error messages are as follows

       AccuraOcr.ACCURA_ERROR_CODE_MOTION("Keep Document Steady");
       AccuraOcr.ACCURA_ERROR_CODE_DOCUMENT_IN_FRAME("Keep document in frame");
       AccuraOcr.ACCURA_ERROR_CODE_BRING_DOCUMENT_IN_FRAME("Bring card near to frame");
       AccuraOcr.ACCURA_ERROR_CODE_PROCESSING("Processing");
       AccuraOcr.ACCURA_ERROR_CODE_BLUR_DOCUMENT("Blur detect in document");
       AccuraOcr.ACCURA_ERROR_CODE_FACE_BLUR("Blur detected over face");
       AccuraOcr.ACCURA_ERROR_CODE_GLARE_DOCUMENT("Glare detect in document");
       AccuraOcr.ACCURA_ERROR_CODE_HOLOGRAM("Hologram Detected");
       AccuraOcr.ACCURA_ERROR_CODE_DARK_DOCUMENT("Low lighting detected");
       AccuraOcr.ACCURA_ERROR_CODE_PHOTO_COPY_DOCUMENT("Can not accept Photo Copy Document");
       AccuraOcr.ACCURA_ERROR_CODE_FACE("Face not detected");
       AccuraOcr.ACCURA_ERROR_CODE_MRZ("MRZ not detected");
       AccuraOcr.ACCURA_ERROR_CODE_PASSPORT_MRZ("Passport MRZ not detected");
       AccuraOcr.ACCURA_ERROR_CODE_ID_MRZ("ID MRZ not detected");
       AccuraOcr.ACCURA_ERROR_CODE_VISA_MRZ("Visa MRZ not detected");
       AccuraOcr.ACCURA_ERROR_CODE_UPSIDE_DOWN_SIDE("Document is upside down. Place it properly");
       AccuraOcr.ACCURA_ERROR_CODE_WRONG_SIDE("Scanning wrong side of Document");
       AccuraOcr.Disable_Card_Name(false);

Methods use to set Scaning title messages are as follows

       AccuraOcr.SCAN_TITLE_OCR_FRONT("Scan Front side of ");
       AccuraOcr.SCAN_TITLE_OCR_BACK("Scan Back side of ");
       AccuraOcr.SCAN_TITLE_OCR("Scan ");
       AccuraOcr.SCAN_TITLE_MRZ_PDF417_FRONT("Scan Front Side of Document");
       AccuraOcr.SCAN_TITLE_MRZ_PDF417_BACK("Scan Back Side of Document");
       AccuraOcr.SCAN_TITLE_DLPLATE("Scan Number plate");
       AccuraOcr.SCAN_TITLE_BARCODE("Scan Barcode");
       AccuraOcr.SCAN_TITLE_BANKCARD("Scan BankCard");

Methods use to set Camera customization are as follows

       AccuraOcr.isShowLogo(0);
       AccuraOcr.isFlipImg(1);
       AccuraOcr.CameraScreen_Border_Width(10);  // To set the width of the frame
       AccuraOcr.CameraScreen_CornerBorder_Enable(true); //To enable corner Only frame
       AccuraOcr.CameraScreen_Color("#80000000");   //Pass empty string for clear color else pass the Hex code e.g, #FFFFFF.
       AccuraOcr.CameraScreen_Back_Button(1); //For iOS disable the back button by Passing 0.
       AccuraOcr.CameraScreen_Change_Button(1); //To disable flip camera button pass 0.
       AccuraOcr.CameraScreen_Frame_Color("#D5323F"); //Pass a Hex Code to change the color of the frame.
       AccuraOcr.CameraScreen_Text_Border_Color("#000000"); //Pass a Hex Code to change the color of the text border pass empty string to disable it.
       AccuraOcr.CameraScreen_Text_Color("#FFFFFF"); //Pass a Hex Code to change the color of the text.

Methods use to set all the above configuration is

AccuraOcr.setAccuraConfigs();

The example function is shown below

 Future<void> setAccuraConfig() async{
    try {

      await AccuraOcr.setFaceBlurPercentage(80);
      await AccuraOcr.setHologramDetection(true);
      await AccuraOcr.setLowLightTolerance(10);
      await AccuraOcr.setMotionThreshold(25);
      await AccuraOcr.setMinGlarePercentage(6);
      await AccuraOcr.setMaxGlarePercentage(99);
      await AccuraOcr.setBlurPercentage(60);
      await AccuraOcr.setCameraFacing(0);

      await AccuraOcr.SCAN_TITLE_OCR_FRONT("Scan Front side of ");
      await AccuraOcr.SCAN_TITLE_OCR_BACK("Scan Back side of ");
      await AccuraOcr.SCAN_TITLE_OCR("Scan ");
      await AccuraOcr.SCAN_TITLE_MRZ_PDF417_FRONT("Scan Front Side of Document");
      await AccuraOcr.SCAN_TITLE_MRZ_PDF417_BACK("Scan Back Side of Document");
      await AccuraOcr.SCAN_TITLE_DLPLATE("Scan Number plate");
      await AccuraOcr.SCAN_TITLE_BARCODE("Scan Barcode");
      await AccuraOcr.SCAN_TITLE_BANKCARD("Scan BankCard");


      await AccuraOcr.ACCURA_ERROR_CODE_MOTION("Keep Document Steady");
      await AccuraOcr.ACCURA_ERROR_CODE_DOCUMENT_IN_FRAME("Keep document in frame");
      await AccuraOcr.ACCURA_ERROR_CODE_BRING_DOCUMENT_IN_FRAME("Bring card near to frame");
      await AccuraOcr.ACCURA_ERROR_CODE_PROCESSING("Processing");
      await AccuraOcr.ACCURA_ERROR_CODE_BLUR_DOCUMENT("Blur detect in document");
      await AccuraOcr.ACCURA_ERROR_CODE_FACE_BLUR("Blur detected over face");
      await AccuraOcr.ACCURA_ERROR_CODE_GLARE_DOCUMENT("Glare detect in document");
      await AccuraOcr.ACCURA_ERROR_CODE_HOLOGRAM("Hologram Detected");
      await AccuraOcr.ACCURA_ERROR_CODE_DARK_DOCUMENT("Low lighting detected");
      await AccuraOcr.ACCURA_ERROR_CODE_PHOTO_COPY_DOCUMENT("Can not accept Photo Copy Document");
      await AccuraOcr.ACCURA_ERROR_CODE_FACE("Face not detected");
      await AccuraOcr.ACCURA_ERROR_CODE_MRZ("MRZ not detected");
      await AccuraOcr.ACCURA_ERROR_CODE_PASSPORT_MRZ("Passport MRZ not detected");
      await AccuraOcr.ACCURA_ERROR_CODE_ID_MRZ("ID MRZ not detected");
      await AccuraOcr.ACCURA_ERROR_CODE_VISA_MRZ("Visa MRZ not detected");
      await AccuraOcr.ACCURA_ERROR_CODE_UPSIDE_DOWN_SIDE("Document is upside down. Place it properly");
      await AccuraOcr.ACCURA_ERROR_CODE_WRONG_SIDE("Scanning wrong side of Document");
      await AccuraOcr.isShowLogo(0);
      await AccuraOcr.isFlipImg(1);
      await AccuraOcr.CameraScreen_Border_Width(10);
      await AccuraOcr.CameraScreen_CornerBorder_Enable(true);
      await AccuraOcr.CameraScreen_Color("#80000000");  
      await AccuraOcr.CameraScreen_Back_Button(1); 
      await AccuraOcr.CameraScreen_Change_Button(1); 
      await AccuraOcr.CameraScreen_Frame_Color("#D5323F");
      await AccuraOcr.CameraScreen_Text_Border_Color("#000000"); 
      await AccuraOcr.CameraScreen_Text_Color("#FFFFFF"); 

      AccuraOcr.setAccuraConfigs();

    }on PlatformException{}
  }

Last updated