com.aspose.barcode.barcoderecognition

Class QualitySettings

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


  • public final class QualitySettings
    extends java.lang.Object

    QualitySettings allows to configure recognition quality and speed manually. You can quickly set up QualitySettings by embedded presets: HighPerformance, NormalQuality, HighQuality, MaxBarCodes or you can manually configure separate options. Default value of QualitySettings is NormalQuality.


     This sample shows how to use QualitySettings with BarCodeReader
     
     BarCodeReader reader = new BarCodeReader("test.png");
     //set high performance mode
     reader.setQualitySettings(QualitySettings.getHighPerformance());
     while (reader.read())
     {
       System.out.println("BarCode CodeText: " + reader.getCodeText());
     }
    
     using (BarCodeReader reader = new BarCodeReader(@"c:\test.jpg"))
     {
         //normal quality mode is set by default
         while (reader.Read())
             Console.WriteLine("BarCode CodeText: " + reader.GetCodeText());
     }
     using (BarCodeReader reader = new BarCodeReader(@"c:\test.jpg"))
     {
         //set high quality mode with low speed recognition
         reader.QualitySettings = QualitySettings.HighQuality;
         while (reader.Read())
             Console.WriteLine("BarCode CodeText: " + reader.GetCodeText());
     }
     using (BarCodeReader reader = new BarCodeReader(@"c:\test.jpg"))
     {
         //set max barcodes mode, which tries to find all possible barcodes, even incorrect. The slowest recognition mode
         reader.QualitySettings = QualitySettings.MaxBarCodes;
         while (reader.Read())
             Console.WriteLine("BarCode CodeText: " + reader.GetCodeText());
     }
    
     BarCodeReader reader = new BarCodeReader("test.png");
     /set high performance mode
     reader.setQualitySettings(QualitySettings.getHighPerformance());
     //set separate options
     reader.getQualitySettings().setAllowMedianSmoothing(true);
     reader.getQualitySettings().setMedianSmoothingWindowSize(5);
     while (reader.read())
     {
      System.out.println("BarCode CodeText: " + reader.getCodeText());
     }
    
     BarCodeReader reader = new BarCodeReader("test.png");
     {
     //default mode is NormalQuality
     //set separate options
     reader.getQualitySettings().setAllowMedianSmoothing(true);
     reader.getQualitySettings().setMedianSmoothingWindowSize(5);
     while (reader.read())
     {
           System.out.println("BarCode CodeText: " + reader.getCodeText());
     }
     

    • Constructor Detail

      • QualitySettings

        public QualitySettings()

        QualitySettings constructor

      • QualitySettings

        public QualitySettings(QualitySettings Settings)

        QualitySettings copy constructor

        Parameters:
        Settings - NEED TO IMPLEMENT DOCUMENTATION FOR THIS VALUE
    • Method Detail

      • getHighPerformance

        public static QualitySettings getHighPerformance()

        HighPerformance recognition quality preset. High quality barcodes are recognized well in this mode.

         BarCodeReader reader = new BarCodeReader("test.jpg");
          reader.setQualitySettings(QualitySettings.getHighPerformance());
         

        Value: HighPerformance recognition quality preset.
      • getNormalQuality

        public static QualitySettings getNormalQuality()

        NormalQuality recognition quality preset. Suitable for the most of barcodes

         BarCodeReader reader = new BarCodeReader("test.jpg");
         reader.setQualitySettings(QualitySettings.getNormalQuality());
         

        Value: NormalQuality recognition quality preset.
      • getHighQuality

        public static QualitySettings getHighQuality()

        HighQuality recognition quality preset. This preset is developed for low quality barcodes.

         BarCodeReader reader = new BarCodeReader("test.jpg");
         reader.setQualitySettings(QualitySettings.getHighQuality());
         

        Value: HighQuality recognition quality preset.
      • getMaxBarCodes

        public static QualitySettings getMaxBarCodes()

        MaxBarCodes recognition quality preset. This preset is developed to recognize all possible barcodes, even incorrect barcodes.

         BarCodeReader reader = new BarCodeReader("test.jpg");
         reader.setQualitySettings(QualitySettings.getMaxBarCodes());
         

        Value: MaxBarCodes recognition quality preset.
      • getAllowInvertImage

        public final boolean getAllowInvertImage()

        Allows engine to recognize inverse color image as additional scan. Mode can be used when barcode is white on black background.

        Value: Allows engine to recognize inverse color image.
      • setAllowInvertImage

        public final void setAllowInvertImage(boolean value)

        Allows engine to recognize inverse color image as additional scan. Mode can be used when barcode is white on black background.

        Value: Allows engine to recognize inverse color image.
      • getAllowIncorrectBarcodes

        public final boolean getAllowIncorrectBarcodes()

        Allows engine to recognize barcodes which has incorrect checksumm or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text.

        Value: Allows engine to recognize incorrect barcodes.
      • setAllowIncorrectBarcodes

        public final void setAllowIncorrectBarcodes(boolean value)

        Allows engine to recognize barcodes which has incorrect checksumm or incorrect values. Mode can be used to recognize damaged barcodes with incorrect text.

        Value: Allows engine to recognize incorrect barcodes.
      • getAllowComplexBackground

        public final boolean getAllowComplexBackground()

        Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode.

        Value: Allows engine to recognize color barcodes on color background.
      • setAllowComplexBackground

        public final void setAllowComplexBackground(boolean value)

        Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode.

        Value: Allows engine to recognize color barcodes on color background.
      • getAllowMedianSmoothing

        public final boolean getAllowMedianSmoothing()

        Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes.

        Value: Allows engine to enable median smoothing.
      • setAllowMedianSmoothing

        public final void setAllowMedianSmoothing(boolean value)

        Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes.

        Value: Allows engine to enable median smoothing.
      • getMedianSmoothingWindowSize

        public final int getMedianSmoothingWindowSize()

        Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set.

        Value: Window size for median smoothing.
      • setMedianSmoothingWindowSize

        public final void setMedianSmoothingWindowSize(int value)

        Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set.

        Value: Window size for median smoothing.
      • getAllowRegularImage

        public final boolean getAllowRegularImage()

        Allows engine to recognize regular image without any restorations as main scan. Mode to recognize image as is.

        Value: Allows to recognize regular image without any restorations.
      • setAllowRegularImage

        public final void setAllowRegularImage(boolean value)

        Allows engine to recognize regular image without any restorations as main scan. Mode to recognize image as is.

        Value: Allows to recognize regular image without any restorations.
      • getAllowDecreasedImage

        public final boolean getAllowDecreasedImage()

        Allows engine to recognize decreased image as additional scan. Size for decreasing is selected by internal engine algorithms. Mode helps to recognize barcodes which are noised and blurred but captured with high resolution.

        Value: Allows engine to recognize decreased image
      • setAllowDecreasedImage

        public final void setAllowDecreasedImage(boolean value)

        Allows engine to recognize decreased image as additional scan. Size for decreasing is selected by internal engine algorithms. Mode helps to recognize barcodes which are noised and blurred but captured with high resolution.

        Value: Allows engine to recognize decreased image
      • getAllowWhiteSpotsRemoving

        public final boolean getAllowWhiteSpotsRemoving()

        Allows engine to recognize image without small white spots as additional scan. Mode helps to recognize noised image as well as median smoothing filtering.

        Value: Allows engine to recognize image without small white spots.
      • setAllowWhiteSpotsRemoving

        public final void setAllowWhiteSpotsRemoving(boolean value)

        Allows engine to recognize image without small white spots as additional scan. Mode helps to recognize noised image as well as median smoothing filtering.

        Value: Allows engine to recognize image without small white spots.
      • getAllowOneDAdditionalScan

        public final boolean getAllowOneDAdditionalScan()

        Allows engine for 1D barcodes to recognize regular image with different params as additional scan. Mode helps to recongize low height 1D barcodes.

        Value: Allows engine for 1D barcodes to run additional scan.
      • setAllowOneDAdditionalScan

        public final void setAllowOneDAdditionalScan(boolean value)

        Allows engine for 1D barcodes to recognize regular image with different params as additional scan. Mode helps to recongize low height 1D barcodes.

        Value: Allows engine for 1D barcodes to run additional scan.
      • getAllowOneDFastBarcodesDetector

        public final boolean getAllowOneDFastBarcodesDetector()

        Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image. Mode helps to quickly recognize generated barcodes from Internet.

        Value: Allows engine for 1D barcodes to quickly recognize high quality barcodes.
      • setAllowOneDFastBarcodesDetector

        public final void setAllowOneDFastBarcodesDetector(boolean value)

        Allows engine for 1D barcodes to quickly recognize high quality barcodes which fill almost whole image. Mode helps to quickly recognize generated barcodes from Internet.

        Value: Allows engine for 1D barcodes to quickly recognize high quality barcodes.
      • getAllowMicroWhiteSpotsRemoving

        public final boolean getAllowMicroWhiteSpotsRemoving()

        Allows engine for Postal barcodes to recognize slightly noised images. Mode helps to recognize sligtly damaged Postal barcodes.

        Value: Allows engine for Postal barcodes to recognize slightly noised images.
      • setAllowMicroWhiteSpotsRemoving

        public final void setAllowMicroWhiteSpotsRemoving(boolean value)

        Allows engine for Postal barcodes to recognize slightly noised images. Mode helps to recognize sligtly damaged Postal barcodes.

        Value: Allows engine for Postal barcodes to recognize slightly noised images.
      • getAllowSaltAndPaperFiltering

        public final boolean getAllowSaltAndPaperFiltering()

        Allows engine to recognize barcodes with salt and paper noise type. Mode can remove small noise with white and black dots.

        Value: Allows engine to recognize barcodes with salt and paper noise type.
      • setAllowSaltAndPaperFiltering

        public final void setAllowSaltAndPaperFiltering(boolean value)

        Allows engine to recognize barcodes with salt and paper noise type. Mode can remove small noise with white and black dots.

        Value: Allows engine to recognize barcodes with salt and paper noise type.
      • getAllowDetectScanGap

        public final boolean getAllowDetectScanGap()

        Allows engine to use gap between scans to increase recognition speed. Mode can make recognition problems with low height barcodes.

        Value: Allows engine to use gap between scans to increase recognition speed.
      • setAllowDetectScanGap

        public final void setAllowDetectScanGap(boolean value)

        Allows engine to use gap between scans to increase recognition speed. Mode can make recognition problems with low height barcodes.

        Value: Allows engine to use gap between scans to increase recognition speed.
      • getAllowDatamatrixIndustrialBarcodes

        public final boolean getAllowDatamatrixIndustrialBarcodes()

        Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes. Slow mode which helps only for dashed barcodes which consist from spots.

        Value: Allows engine for Datamatrix to recognize dashed industrial barcodes.
      • setAllowDatamatrixIndustrialBarcodes

        public final void setAllowDatamatrixIndustrialBarcodes(boolean value)

        Allows engine for Datamatrix to recognize dashed industrial Datamatrix barcodes. Slow mode which helps only for dashed barcodes which consist from spots.

        Value: Allows engine for Datamatrix to recognize dashed industrial barcodes.
      • getAllowQRMicroQrRestoration

        public final boolean getAllowQRMicroQrRestoration()

        Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes.

        Value: Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes.
      • setAllowQRMicroQrRestoration

        public final void setAllowQRMicroQrRestoration(boolean value)

        Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes.

        Value: Allows engine for QR/MicroQR to recognize damaged MicroQR barcodes.
      • getAllowOneDWipedBarsRestoration

        public boolean getAllowOneDWipedBarsRestoration()

        Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern.

        Value: Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern.
      • setAllowOneDWipedBarsRestoration

        public void setAllowOneDWipedBarsRestoration(boolean value)

        Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern.

        Value: Allows engine for 1D barcodes to recognize barcodes with single wiped/glued bars in pattern.
      • applyAll

        public final void applyAll(QualitySettings Src)

        Function apply all values from Src setting to this

        Parameters:
        Src - source settings