Class Ocr

java.lang.Object
glair.vision.api.Ocr

public class Ocr extends Object
The Ocr class provides methods for performing Optical Character Recognition (OCR) operations.
  • Constructor Details

    • Ocr

      public Ocr(Config config)
      Constructs an Ocr instance with the provided configuration.
      Parameters:
      config - The configuration settings to use for OCR operations.
  • Method Details

    • ktpSessions

      public KtpSessions ktpSessions()
      Get access to KTP Sessions related operations.
      Returns:
      An instance of KtpSessions for KTP operations.
    • npwpSessions

      public NpwpSessions npwpSessions()
      Get access to NPWP Sessions related operations.
      Returns:
      An instance of NpwpSessions for NPWP operations.
    • ktp

      public String ktp(KtpParam param) throws Exception
      Perform OCR on a KTP image using default configuration settings.
      Parameters:
      param - The OCR parameters, including the path to the KTP image file and an optional qualities detector setting.
      Returns:
      The OCR result for the KTP image.
      Throws:
      Exception - If an error occurs during the OCR process.
    • ktp

      public String ktp(KtpParam param, VisionSettings newVisionSettings) throws Exception
      Perform OCR on a KTP image using custom configuration settings.
      Parameters:
      param - The OCR parameters, including the path to the KTP image file and an optional qualities detector setting.
      newVisionSettings - The custom vision settings to use.
      Returns:
      The OCR result for the KTP image.
      Throws:
      Exception - If an error occurs during the OCR process.
    • npwp

      public String npwp(String imagePath) throws Exception
      Perform OCR on an NPWP image using default configuration settings.
      Parameters:
      imagePath - The path to the NPWP image file.
      Returns:
      The OCR result for the NPWP image.
      Throws:
      Exception - If an error occurs during the OCR process.
    • npwp

      public String npwp(String imagePath, VisionSettings newVisionSettings) throws Exception
      Perform OCR on an NPWP image using custom configuration settings.
      Parameters:
      imagePath - The path to the NPWP image file.
      newVisionSettings - The custom vision settings to use.
      Returns:
      The OCR result for the NPWP image.
      Throws:
      Exception - If an error occurs during the OCR process.
    • kk

      public String kk(String imagePath) throws Exception
      Perform OCR on an KK image using default configuration settings.
      Parameters:
      imagePath - The path to the KK image file.
      Returns:
      The OCR result for the KK image.
      Throws:
      Exception - If an error occurs during the OCR process.
    • kk

      public String kk(String imagePath, VisionSettings newVisionSettings) throws Exception
      Perform OCR on an KK image using custom configuration settings.
      Parameters:
      imagePath - The path to the KK image file.
      newVisionSettings - The custom vision settings to use.
      Returns:
      The OCR result for the KK image.
      Throws:
      Exception - If an error occurs during the OCR process.
    • stnk

      public String stnk(String imagePath) throws Exception
      Perform OCR on an STNK image using default configuration settings.
      Parameters:
      imagePath - The path to the STNK image file.
      Returns:
      The OCR result for the STNK image.
      Throws:
      Exception - If an error occurs during the OCR process.
    • stnk

      public String stnk(String imagePath, VisionSettings newVisionSettings) throws Exception
      Perform OCR on an STNK image using custom configuration settings.
      Parameters:
      imagePath - The path to the STNK image file.
      newVisionSettings - The custom vision settings to use.
      Returns:
      The OCR result for the STNK image.
      Throws:
      Exception - If an error occurs during the OCR process.
    • bpkb

      public String bpkb(BpkbParam param) throws Exception
      Perform OCR on a BPKB image using default configuration settings.
      Parameters:
      param - The parameters for OCR, including the path to the BPKB image file and an optional page number (1-4).
      Returns:
      The OCR result for the BPKB image.
      Throws:
      Exception - If an error occurs during the OCR process, such as if the file does not exist.
    • bpkb

      public String bpkb(BpkbParam param, VisionSettings newVisionSettings) throws Exception
      Perform OCR on a BPKB image using custom configuration settings.
      Parameters:
      param - The parameters for OCR, including the path to the BPKB image file and an optional page number (1-4).
      newVisionSettings - The custom vision settings to use.
      Returns:
      The OCR result for the BPKB image.
      Throws:
      Exception - If an error occurs during the OCR process, such as if the file does not exist.
    • passport

      public String passport(String imagePath) throws Exception
      Perform OCR on a Passport image using default configuration settings.
      Parameters:
      imagePath - The path to the Passport image file.
      Returns:
      The OCR result for the Passport image.
      Throws:
      Exception - If an error occurs during the OCR process.
    • passport

      public String passport(String imagePath, VisionSettings newVisionSettings) throws Exception
      Perform OCR on a Passport image using custom configuration settings.
      Parameters:
      imagePath - The path to the Passport image file.
      newVisionSettings - The custom vision settings to use.
      Returns:
      The OCR result for the Passport image.
      Throws:
      Exception - If an error occurs during the OCR process.
    • licensePlate

      public String licensePlate(String imagePath) throws Exception
      Perform OCR on a License Plate image using default configuration settings.
      Parameters:
      imagePath - The path to the License Plate image file.
      Returns:
      The OCR result for the License Plate image.
      Throws:
      Exception - If an error occurs during the OCR process.
    • licensePlate

      public String licensePlate(String imagePath, VisionSettings newVisionSettings) throws Exception
      Perform OCR on a License Plate image using custom configuration settings.
      Parameters:
      imagePath - The path to the License Plate image file.
      newVisionSettings - The custom vision settings to use.
      Returns:
      The OCR result for the License Plate image.
      Throws:
      Exception - If an error occurs during the OCR process.
    • generalDocument

      public String generalDocument(String imagePath) throws Exception
      Perform OCR on a General Document image using default configuration settings.
      Parameters:
      imagePath - The path to the General Document image file.
      Returns:
      The OCR result for the General Document image.
      Throws:
      Exception - If an error occurs during the OCR process.
    • generalDocument

      public String generalDocument(String imagePath, VisionSettings newVisionSettings) throws Exception
      Perform OCR on a General Document image using custom configuration settings.
      Parameters:
      imagePath - The path to the General Document image file.
      newVisionSettings - The custom vision settings to use.
      Returns:
      The OCR result for the General Document image.
      Throws:
      Exception - If an error occurs during the OCR process.
    • invoice

      public String invoice(String imagePath) throws Exception
      Perform OCR on an Invoice image using default configuration settings.
      Parameters:
      imagePath - The path to the Invoice image file.
      Returns:
      The OCR result for the Invoice image.
      Throws:
      Exception - If an error occurs during the OCR process.
    • invoice

      public String invoice(String imagePath, VisionSettings newVisionSettings) throws Exception
      Perform OCR on an Invoice image using custom configuration settings.
      Parameters:
      imagePath - The path to the Invoice image file.
      newVisionSettings - The custom vision settings to use.
      Returns:
      The OCR result for the Invoice image.
      Throws:
      Exception - If an error occurs during the OCR process.
    • receipt

      public String receipt(String imagePath) throws Exception
      Perform OCR on a Receipt image using default configuration settings.
      Parameters:
      imagePath - The path to the Receipt image file.
      Returns:
      The OCR result for the Receipt image.
      Throws:
      Exception - If an error occurs during the OCR process.
    • receipt

      public String receipt(String imagePath, VisionSettings newVisionSettings) throws Exception
      Perform OCR on a Receipt image using custom configuration settings.
      Parameters:
      imagePath - The path to the Receipt image file.
      newVisionSettings - The custom vision settings to use.
      Returns:
      The OCR result for the Receipt image.
      Throws:
      Exception - If an error occurs during the OCR process.