def __init__(self):
        dataDir = Settings.dataDir + 'WorkingWithBarcodeRecognition/AdvancedBarcodeRecognitionFeatures/RecognizeSpecificSymbology/'
        
        # initialize barcode reader
        img = dataDir + "barcode.jpg"
        barcode_reader_type = BarCodeReadType
        rd = BarCodeReader(img, barcode_reader_type.Code39Standard)

        # read barcode
        while (rd.read()):
            # print the code text, if barcode found
            print "CodeText: "
            print rd.getCodeText()

            # print the symbology type
            print "Type: "
            print rd.getReadType()
Exemple #2
0
    def __init__(self):
        dataDir = Settings.dataDir + 'WorkingWithBarcodeRecognition/AdvancedBarcodeRecognitionFeatures/RecognizeSpecificSymbology/'

        # initialize barcode reader
        img = dataDir + "barcode.jpg"
        barcode_reader_type = BarCodeReadType
        rd = BarCodeReader(img, barcode_reader_type.Code39Standard)

        # read barcode
        while (rd.read()):
            # print the code text, if barcode found
            print "CodeText: "
            print rd.getCodeText()

            # print the symbology type
            print "Type: "
            print rd.getReadType()
    def __init__(self):
        dataDir = Settings.dataDir + 'WorkingWithBarcodeRecognition/AdvancedBarcodeRecognitionFeatures/GetBarcodeRecognitionQuality/'

        img = dataDir + "barcode.jpg"

        # initialize barcode reader
        barcode_reader_type = BarCodeReadType
        reader = BarCodeReader(img, barcode_reader_type.Code39Standard)

        # Call read method
        while (reader.read()):
            print "Barcode CodeText: " + reader.getCodeText()
            print " Barcode Type: "
            print reader.getReadType()
            percent = reader.getRecognitionQuality()
            print "Barcode Quality Percentage: "
            print percent

        # Close reader
        reader.close()
    def __init__(self):
        dataDir = Settings.dataDir + 'WorkingWithBarcodeRecognition/AdvancedBarcodeRecognitionFeatures/GetBarcodeRecognitionQuality/'
        
        img = dataDir + "barcode.jpg"

        # initialize barcode reader
        barcode_reader_type = BarCodeReadType
        reader = BarCodeReader(img, barcode_reader_type.Code39Standard)

        # Call read method
        while (reader.read()):
            print "Barcode CodeText: " + reader.getCodeText()
            print " Barcode Type: "
            print reader.getReadType()
            percent = reader.getRecognitionQuality()
            print "Barcode Quality Percentage: "
            print percent
        

        # Close reader
        reader.close()
Exemple #5
0
    def __init__(self):
        dataDir = Settings.dataDir + 'WorkingWithBarcodeRecognition/AdvancedBarcodeRecognitionFeatures/MakingBarcodeRegions/'

        # initialize barcode reader
        img = dataDir + "barcode.jpg"
        barcode_reader_type = BarCodeReadType
        reader = BarCodeReader(img, barcode_reader_type.Code39Standard)

        # Try to recognize all possible barcodes in the image
        while (reader.read()):
            # Display the symbology type
            print "BarCode Type: "
            print reader.getReadType()
            # Display the codetext
            print "BarCode CodeText: "
            print reader.getCodeText()
            # Get the barcode region
            region = reader.getRegion()

            if (region != ""):
                # Initialize an object of type BufferedImage to get the Graphics object
                imageIO = ImageIO
                bufferedImage = imageIO.read(File(img))

                # Initialize graphics object from the image
                g = bufferedImage.getGraphics()

                color = Color
                # Initialize paint object
                p = GradientPaint(0, 0, color.red, 100, 100, color.pink, True)

                region.drawBarCodeEdges(g, color.RED)

                # Save the image

                imageIO.write(bufferedImage, "png",
                              File(dataDir + "Code39StdOut.png"))

        # Close reader
        reader.close()
    def __init__(self):
        dataDir = Settings.dataDir + 'WorkingWithBarcodeRecognition/AdvancedBarcodeRecognitionFeatures/ReadBarcodeFromSpecificRegion/'
        
        # Open the stream. Read only access is enough for Aspose.BarCode to load an image.
        stream = FileInputStream(dataDir + "test.png")

        # Create an instance of BarCodeReader class
        # and specify an area to look for the barcode

        barcode_reader_type =  BarCodeReadType
        reader =  BarCodeReader(stream,  Rectangle(0, 0, 10, 50), barcode_reader_type.Code39Standard)

        # TRead all barcodes in the provided area
        while (reader.read()):
            # Display the codetext and symbology type of the barcode found
            print "Codetext: "
            print reader.getCodeText()
            print " Symbology: "
            print reader.getReadType()        

        # Close reader
        reader.close()
    def __init__(self):
        dataDir = Settings.dataDir + 'WorkingWithBarcodeRecognition/AdvancedBarcodeRecognitionFeatures/MakingBarcodeRegions/'
        
        # initialize barcode reader
        img = dataDir + "barcode.jpg"
        barcode_reader_type = BarCodeReadType
        reader = BarCodeReader(img, barcode_reader_type.Code39Standard)

        # Try to recognize all possible barcodes in the image
        while (reader.read()):
            # Display the symbology type
            print "BarCode Type: " 
            print reader.getReadType()
            # Display the codetext
            print "BarCode CodeText: "
            print reader.getCodeText()
            # Get the barcode region
            region = reader.getRegion()

            if (region != ""):
            # Initialize an object of type BufferedImage to get the Graphics object
                imageIO=ImageIO
                bufferedImage = imageIO . read(File(img))

                # Initialize graphics object from the image
                g = bufferedImage . getGraphics()

                color = Color
                # Initialize paint object
                p = GradientPaint(0, 0, color.red, 100, 100, color.pink, True)

                region.drawBarCodeEdges(g, color.RED)

                # Save the image

                imageIO.write(bufferedImage, "png", File(dataDir + "Code39StdOut.png"))
      
        # Close reader
        reader.close()
Exemple #8
0
    def __init__(self):
        dataDir = Settings.dataDir + 'WorkingWithBarcodeRecognition/AdvancedBarcodeRecognitionFeatures/ReadBarcodeFromSpecificRegion/'

        # Open the stream. Read only access is enough for Aspose.BarCode to load an image.
        stream = FileInputStream(dataDir + "test.png")

        # Create an instance of BarCodeReader class
        # and specify an area to look for the barcode

        barcode_reader_type = BarCodeReadType
        reader = BarCodeReader(stream, Rectangle(0, 0, 10, 50),
                               barcode_reader_type.Code39Standard)

        # TRead all barcodes in the provided area
        while (reader.read()):
            # Display the codetext and symbology type of the barcode found
            print "Codetext: "
            print reader.getCodeText()
            print " Symbology: "
            print reader.getReadType()

        # Close reader
        reader.close()