com.aspose.barcode.barcoderecognition

Class BarCodeResult

  • java.lang.Object
    • com.aspose.barcode.barcoderecognition.BarCodeResult


  • public final class BarCodeResult
    extends java.lang.Object

    Stores recognized barcode data like SingleDecodeType type, string codetext, BarCodeRegionParameters region and other parameters


     This sample shows how to obtain BarCodeResult.
     
     BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.Code128, "12345");
     generator.save("c:\\test.png");
     BarCodeReader reader = new BarCodeReader("c:\\test.png", DecodeType.CODE_39_STANDARD, DecodeType.CODE_128);
     for(BarCodeResult result : reader.readBarCodes())
     {
         System.out.println("BarCode Type: " + result.getCodeTypeName());
         System.out.println("BarCode CodeText: " + result.getCodeText());
         System.out.println("BarCode Confidence: " + result.getConfidence());
         System.out.println("BarCode ReadingQuality: " + result.getReadingQuality());
         System.out.println("BarCode Angle: " + result.getRegion().getAngle());
     }
     
    • Constructor Summary

      Constructors 
      Constructor and Description
      BarCodeResult(BarCodeResult result)
      Creates a a copy of the BarCodeResult class.
      BarCodeResult(com.aspose.barcode.barcoderecognition.recognition.recognitionsession.coderesult.CodeResult aResult)
      Creates a new instance of the BarCodeResult class with data accepted from CodeResult class
    • Constructor Detail

      • BarCodeResult

        public BarCodeResult(BarCodeResult result)

        Creates a a copy of the BarCodeResult class.

        Parameters:
        result - An copy BarCodeResult instance.
      • BarCodeResult

        public BarCodeResult(com.aspose.barcode.barcoderecognition.recognition.recognitionsession.coderesult.CodeResult aResult)

        Creates a new instance of the BarCodeResult class with data accepted from CodeResult class

        Parameters:
        aResult - An internal recognized barcode data
    • Method Detail

      • getReadingQuality

        public double getReadingQuality()

        Gets the reading quality. Works for 1D and postal barcodes.

        Value: The reading quality percent
      • getConfidence

        public int getConfidence()

        Gets recognition confidence level of the recognized barcode

        Value: BarCodeConfidence.Strong does not have fakes or misrecognitions, BarCodeConfidence.Moderate could sometimes have fakes or incorrect codetext because this confidence level for barcodews with weak cheksum or even without it, BarCodeConfidence.None always has incorrect codetext and could be fake recognitions
      • getCodeText

        public java.lang.String getCodeText()

        Gets the code text

        Value: The code text of the barcode
      • getCodeBytes

        public byte[] getCodeBytes()

        Gets the encoded code bytes

        Value: The code bytes of the barcode
      • getCodeType

        public SingleDecodeType getCodeType()

        Gets the barcode type

        Value: The type information of the recognized barcode
      • getCodeTypeName

        public java.lang.String getCodeTypeName()

        Gets the name of the barcode type

        Value: The type name of the recognized barcode
      • getRegion

        public BarCodeRegionParameters getRegion()

        Gets the barcode region

        Value: The region of the recognized barcode
      • getExtended

        public BarCodeExtendedParameters getExtended()

        Gets extended parameters of recognized barcode

        Value: The extended parameters of recognized barcode
      • getCodeText

        public java.lang.String getCodeText(java.nio.charset.Charset encoding)

        Gets the code text with encoding.

        Parameters:
        encoding - The encoding for codetext.
        Returns:
        A string containing recognized code text.
      • equals

        public boolean equals(BarCodeResult other)

        Returns a value indicating whether this instance is equal to a specified BarCodeResult value.

        Parameters:
        other - An BarCodeResult value to compare to this instance.
        Returns:
        <b>true</b> if obj has the same value as this instance; otherwise, <b>false</b>.
      • equals

        public boolean equals(java.lang.Object obj)

        Returns a value indicating whether this instance is equal to a specified BarCodeResult value.

        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - An System.Object value to compare to this instance.
        Returns:
        <b>true</b> if obj has the same value as this instance; otherwise, <b>false</b>.
      • op_Equality

        public static boolean op_Equality(BarCodeResult first,
                                          BarCodeResult second)

        Returns a value indicating whether the first BarCodeResult value is equal to the second.

        Parameters:
        first - A first compared value
        second - A second compared value
        Returns:
        <b>true</b> if first has the same value as second; otherwise, <b>false</b>.
      • op_Inequality

        public static boolean op_Inequality(BarCodeResult first,
                                            BarCodeResult second)

        Returns a value indicating if the first BarCodeResult value is different from the second.

        Parameters:
        first - A first compared value
        second - A second compared value
        Returns:
        <b>true</b> if first has the different value from second; otherwise, <b>false</b>.
      • hashCode

        public int hashCode()

        Returns the hash code for this instance.

        Overrides:
        hashCode in class java.lang.Object
        Returns:
        A 32-bit signed integer hash code.
      • toString

        public java.lang.String toString()

        Returns a human-readable string representation of this BarCodeResult.

        Overrides:
        toString in class java.lang.Object
        Returns:
        A string that represents this BarCodeResult.
      • deepClone

        public java.lang.Object deepClone()

        Creates a copy of BarCodeResult class.

        Returns:
        Returns copy of BarCodeResult class.