net.sourceforge.javaocr.scanner
Class DocumentScanner

java.lang.Object
  extended by net.sourceforge.javaocr.scanner.DocumentScanner

Deprecated. duplicates functionlaity

public class DocumentScanner
extends Object

Utility class to scan a document, breaking it into rows and character blocks.

Author:
Ronald B. Cemer

Field Summary
protected  float liberalPolicyAreaWhitespaceFraction
          Deprecated. The minimum fraction of pixels in an area which must be white in order for the area to be considered whitespace when the liberal whitespace policy is in effect.
private static Logger LOG
          Deprecated.  
protected  float minCharBreakWidthAsFractionOfRowHeight
          Deprecated. The minimum arrayWidth of a character break (a vertical column of whitespace that separates two characters on a row of text), expressed as a fraction of the arrayHeight of a row of text.
protected  float minCharWidthAsFractionOfRowHeight
          Deprecated. The minimum arrayWidth of a character, expressed as a fraction of the arrayHeight of a row of text.
protected  float minSpaceWidthAsFractionOfRowHeight
          Deprecated. The minimum arrayWidth of a space, expressed as a fraction of the arrayHeight of a row of text.
protected  float shortRowFraction
          Deprecated. The maximum fraction a row's arrayHeight can be of the previous row's arrayHeight, in order for the new (short) row to be merged in with the previous (tall) row to form a single row.
protected  int whiteThreshold
          Deprecated. The white threshold.
 
Constructor Summary
DocumentScanner()
          Deprecated.  
 
Method Summary
 float getLiberalPolicyAreaWhitespaceFraction()
          Deprecated.  
 float getMinCharBreakWidthAsFractionOfRowHeight()
          Deprecated.  
 float getMinCharWidthAsFractionOfRowHeight()
          Deprecated.  
 float getMinSpaceWidthAsFractionOfRowHeight()
          Deprecated.  
 float getShortRowFraction()
          Deprecated.  
 int getWhiteThreshold()
          Deprecated.  
private  void processRow(PixelImage pixelImage, DocumentScannerListener listener, int[] pixels, int w, int h, int x1, int y1, int x2, int y2)
          Deprecated.  
 void scan(PixelImage pixelImage, DocumentScannerListener listener, int blockX1, int blockY1, int blockX2, int blockY2)
          Deprecated.  
 void setLiberalPolicyAreaWhitespaceFraction(float liberalPolicyAreaWhitespaceFraction)
          Deprecated.  
 void setMinCharBreakWidthAsFractionOfRowHeight(float minCharBreakWidthAsFractionOfRowHeight)
          Deprecated.  
 void setMinCharWidthAsFractionOfRowHeight(float minCharWidthAsFractionOfRowHeight)
          Deprecated.  
 void setMinSpaceWidthAsFractionOfRowHeight(float minSpaceWidthAsFractionOfRowHeight)
          Deprecated.  
 void setShortRowFraction(float shortRowFraction)
          Deprecated.  
 void setWhiteThreshold(int whiteThreshold)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shortRowFraction

protected float shortRowFraction
Deprecated. 
The maximum fraction a row's arrayHeight can be of the previous row's arrayHeight, in order for the new (short) row to be merged in with the previous (tall) row to form a single row.


liberalPolicyAreaWhitespaceFraction

protected float liberalPolicyAreaWhitespaceFraction
Deprecated. 
The minimum fraction of pixels in an area which must be white in order for the area to be considered whitespace when the liberal whitespace policy is in effect.


minSpaceWidthAsFractionOfRowHeight

protected float minSpaceWidthAsFractionOfRowHeight
Deprecated. 
The minimum arrayWidth of a space, expressed as a fraction of the arrayHeight of a row of text.


minCharWidthAsFractionOfRowHeight

protected float minCharWidthAsFractionOfRowHeight
Deprecated. 
The minimum arrayWidth of a character, expressed as a fraction of the arrayHeight of a row of text.


minCharBreakWidthAsFractionOfRowHeight

protected float minCharBreakWidthAsFractionOfRowHeight
Deprecated. 
The minimum arrayWidth of a character break (a vertical column of whitespace that separates two characters on a row of text), expressed as a fraction of the arrayHeight of a row of text.


whiteThreshold

protected int whiteThreshold
Deprecated. 
The white threshold. Any pixel value that is greater than or equal to this value, will be considered to be white space for the purpose of separating rows of text and characters within each row.


LOG

private static final Logger LOG
Deprecated. 
Constructor Detail

DocumentScanner

public DocumentScanner()
Deprecated. 
Method Detail

getShortRowFraction

public float getShortRowFraction()
Deprecated. 
Returns:
The maximum fraction a row's arrayHeight can be of the previous row's arrayHeight, in order for the new (short) row to be merged in with the previous (tall) row to form a single row.

setShortRowFraction

public void setShortRowFraction(float shortRowFraction)
Deprecated. 
Parameters:
shortRowFraction - The maximum fraction a row's arrayHeight can be of the previous row's arrayHeight, in order for the new (short) row to be merged in with the previous (tall) row to form a single row.

getLiberalPolicyAreaWhitespaceFraction

public float getLiberalPolicyAreaWhitespaceFraction()
Deprecated. 
Returns:
The minimum fraction of pixels in an area which must be white in order for the area to be considered whitespace when the liberal whitespace policy is in effect.

setLiberalPolicyAreaWhitespaceFraction

public void setLiberalPolicyAreaWhitespaceFraction(float liberalPolicyAreaWhitespaceFraction)
Deprecated. 
Parameters:
liberalPolicyAreaWhitespaceFraction - The minimum fraction of pixels in an area which must be white in order for the area to be considered whitespace when the liberal whitespace policy is in effect.

getMinSpaceWidthAsFractionOfRowHeight

public float getMinSpaceWidthAsFractionOfRowHeight()
Deprecated. 
Returns:
The minimum arrayWidth of a space, expressed as a fraction of the arrayHeight of a row of text.

setMinSpaceWidthAsFractionOfRowHeight

public void setMinSpaceWidthAsFractionOfRowHeight(float minSpaceWidthAsFractionOfRowHeight)
Deprecated. 
Parameters:
minSpaceWidthAsFractionOfRowHeight - The minimum arrayWidth of a space, expressed as a fraction of the arrayHeight of a row of text.

getMinCharWidthAsFractionOfRowHeight

public float getMinCharWidthAsFractionOfRowHeight()
Deprecated. 
Returns:
The minimum arrayWidth of a character, expressed as a fraction of the arrayHeight of a row of text.

setMinCharWidthAsFractionOfRowHeight

public void setMinCharWidthAsFractionOfRowHeight(float minCharWidthAsFractionOfRowHeight)
Deprecated. 
Parameters:
minCharWidthAsFractionOfRowHeight - The minimum arrayWidth of a character, expressed as a fraction of the arrayHeight of a row of text.

getMinCharBreakWidthAsFractionOfRowHeight

public float getMinCharBreakWidthAsFractionOfRowHeight()
Deprecated. 
Returns:
The minimum arrayWidth of a character break (a vertical column of whitespace that separates two characters on a row of text), expressed as a fraction of the arrayHeight of a row of text.

setMinCharBreakWidthAsFractionOfRowHeight

public void setMinCharBreakWidthAsFractionOfRowHeight(float minCharBreakWidthAsFractionOfRowHeight)
Deprecated. 
Parameters:
minCharBreakWidthAsFractionOfRowHeight - The minimum arrayWidth of a character break (a vertical column of whitespace that separates two characters on a row of text), expressed as a fraction of the arrayHeight of a row of text.

getWhiteThreshold

public int getWhiteThreshold()
Deprecated. 
Returns:
The white threshold. Any pixel value that is greater than or equal to this value, will be considered to be white space for the purpose of separating rows of text and characters within each row.

setWhiteThreshold

public void setWhiteThreshold(int whiteThreshold)
Deprecated. 
Parameters:
whiteThreshold - The white threshold. Any pixel value that is greater than or equal to this value, will be considered to be white space for the purpose of separating rows of text and characters within each row.

scan

public final void scan(PixelImage pixelImage,
                       DocumentScannerListener listener,
                       int blockX1,
                       int blockY1,
                       int blockX2,
                       int blockY2)
Deprecated. 
Parameters:
pixelImage - The PixelImage object to be scanned.
listener - The DocumentScannerListener to receive notifications during the scanning process.
blockX1 - The leftmost pixel position of the area to be scanned, or 0 to start scanning at the left boundary of the image.
blockY1 - The topmost pixel position of the area to be scanned, or 0 to start scanning at the top boundary of the image.
blockX2 - The rightmost pixel position of the area to be scanned, or 0 to stop scanning at the right boundary of the image.
blockY2 - The bottommost pixel position of the area to be scanned, or 0 to stop scanning at the bottom boundary of the image.

processRow

private void processRow(PixelImage pixelImage,
                        DocumentScannerListener listener,
                        int[] pixels,
                        int w,
                        int h,
                        int x1,
                        int y1,
                        int x2,
                        int y2)
Deprecated. 


Copyright © -2012. All Rights Reserved.