com.aspose.barcoderecognition.imaging
Class RotationAdjustmentFilter

java.lang.Object
  extended by com.aspose.barcoderecognition.imaging.RotationAdjustmentFilter
All Implemented Interfaces:
IBitmapFilter

public final class RotationAdjustmentFilter
extends Object
implements IBitmapFilter

Helper class to adjust the rotation angle.


 Adjusting the rotation angle
 
 [C#]
 using (Bitmap bmp = new Bitmap(file))
        {
            RotationAdjustmentFilter rh = new RotationAdjustmentFilter();
            BarCodeReader r = new BarCodeReader(rh.Apply(bmp),BarCodeReadType.QR);
            if(r.Read())
            {
                Console.Out.WriteLine(r.GetCodeText());
            }
        }
 


Constructor Summary
RotationAdjustmentFilter()
           Initializes a new instance of the RotationAdjustmentFilter class.
RotationAdjustmentFilter(int threshold)
           Initializes a new instance of the RotationAdjustmentFilter class.
 
Method Summary
 BufferedImage apply(BufferedImage image)
           Adjusts the bitmap.
 BufferedImage apply(BufferedImage image, Rectangle area)
           
 double detectAngle(BufferedImage image)
           Detects the angle.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RotationAdjustmentFilter

public RotationAdjustmentFilter()

Initializes a new instance of the RotationAdjustmentFilter class.


RotationAdjustmentFilter

public RotationAdjustmentFilter(int threshold)

Initializes a new instance of the RotationAdjustmentFilter class.

Parameters:
threshold - The threshold.It should be a positive int and less than 255.
Method Detail

detectAngle

public double detectAngle(BufferedImage image)

Detects the angle.

Returns:

apply

public BufferedImage apply(BufferedImage image)

Adjusts the bitmap.

Specified by:
apply in interface IBitmapFilter
Returns:
The bitmap object after adjustment.

apply

public BufferedImage apply(BufferedImage image,
                           Rectangle area)
Specified by:
apply in interface IBitmapFilter


Copyright (c) 2002-2012 Aspose Pty Ltd. All Rights Reserved.