net.sf.javaocr.demos.android.utils.image
Class SauvolaImageProcessor

java.lang.Object
  extended by net.sf.javaocr.demos.android.utils.image.SauvolaImageProcessor
All Implemented Interfaces:
ImageProcessor

public class SauvolaImageProcessor
extends Object
implements ImageProcessor

process image with median and Sauvola filter. image supplied for processing shall be of sufficient size to accomodate image region specified on creation

Author:
Konstantin Pribluda

Field Summary
(package private)  int arrayHeight
           
(package private)  int arrayWidth
           
(package private)  int h
           
static int MEDIAN_WINDOW
           
(package private)  PixelImage processImage
           
(package private)  PixelImage returnImage
           
private static double SAUVOLA_WEIGHT
           
static int SAUVOLA_WINDOW
           
private  SauvolaBinarisationFilter sauvolaBinarisationFilter
           
(package private)  int w
           
 
Constructor Summary
SauvolaImageProcessor(int arrayWidth, int arrayHeight, int w, int h, int above, int below)
          create image processor working over region of supplied image.
 
Method Summary
 PixelImage prepareImage(byte[] image, int offsetX, int offsetY)
          process incoming image
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SAUVOLA_WINDOW

public static final int SAUVOLA_WINDOW
See Also:
Constant Field Values

MEDIAN_WINDOW

public static final int MEDIAN_WINDOW
See Also:
Constant Field Values

SAUVOLA_WEIGHT

private static final double SAUVOLA_WEIGHT
See Also:
Constant Field Values

w

final int w

h

final int h

arrayWidth

final int arrayWidth

arrayHeight

final int arrayHeight

processImage

PixelImage processImage

returnImage

PixelImage returnImage

sauvolaBinarisationFilter

private SauvolaBinarisationFilter sauvolaBinarisationFilter
Constructor Detail

SauvolaImageProcessor

public SauvolaImageProcessor(int arrayWidth,
                             int arrayHeight,
                             int w,
                             int h,
                             int above,
                             int below)
create image processor working over region of supplied image. take care in specifying offsets - window size applies to them

Parameters:
w - width of region of interest
h - height of region of interest
above - value for pixels above threshold
below - value for pixels below threshold
Method Detail

prepareImage

public PixelImage prepareImage(byte[] image,
                               int offsetX,
                               int offsetY)
process incoming image

Specified by:
prepareImage in interface ImageProcessor
Parameters:
image - incoming image. may be modified
offsetX - region of interest offset. this data is not available at creation time
offsetY - region of interest offset. this data is not available at creation time
Returns:
processed image


Copyright © -2012. All Rights Reserved.