|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sourceforge.javaocr.ocr.DocumentScanner
public class DocumentScanner
Utility class to scan a document, breaking it into rows and character blocks. TODO: evaluate and maybe rewrite
| 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. |
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(Image pixelImage,
DocumentScannerListener listener,
int w,
int h,
int x1,
int y1,
int x2,
int y2)
Deprecated. |
void |
scan(Image pixelImage,
DocumentScannerListener listener,
int blockX1,
int blockY1,
int blockX2,
int blockY2)
Deprecated. scan document and generate events for interested parties |
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 |
|---|
protected float shortRowFraction
protected float liberalPolicyAreaWhitespaceFraction
protected float minSpaceWidthAsFractionOfRowHeight
protected float minCharWidthAsFractionOfRowHeight
protected float minCharBreakWidthAsFractionOfRowHeight
protected int whiteThreshold
| Constructor Detail |
|---|
public DocumentScanner()
| Method Detail |
|---|
public float getShortRowFraction()
public void setShortRowFraction(float shortRowFraction)
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.public float getLiberalPolicyAreaWhitespaceFraction()
public void setLiberalPolicyAreaWhitespaceFraction(float liberalPolicyAreaWhitespaceFraction)
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.public float getMinSpaceWidthAsFractionOfRowHeight()
public void setMinSpaceWidthAsFractionOfRowHeight(float minSpaceWidthAsFractionOfRowHeight)
minSpaceWidthAsFractionOfRowHeight - The minimum arrayWidth of a space, expressed as a
fraction of the arrayHeight of a row of text.public float getMinCharWidthAsFractionOfRowHeight()
public void setMinCharWidthAsFractionOfRowHeight(float minCharWidthAsFractionOfRowHeight)
minCharWidthAsFractionOfRowHeight - The minimum arrayWidth of a character, expressed as a
fraction of the arrayHeight of a row of text.public float getMinCharBreakWidthAsFractionOfRowHeight()
public void setMinCharBreakWidthAsFractionOfRowHeight(float minCharBreakWidthAsFractionOfRowHeight)
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.public int getWhiteThreshold()
public void setWhiteThreshold(int whiteThreshold)
whiteThreshold - The white threshold. Any pixel empty that is greater than or equal
to this empty, will be considered to be white space for the purpose of separating rows of
text and characters within each row.
public final void scan(Image pixelImage,
DocumentScannerListener listener,
int blockX1,
int blockY1,
int blockX2,
int blockY2)
ImageScanner
scan in interface ImageScannerpixelImage - 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.
private final void processRow(Image pixelImage,
DocumentScannerListener listener,
int w,
int h,
int x1,
int y1,
int x2,
int y2)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||