|
Neuroph | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.neuroph.contrib.ocr.OcrUtils
public class OcrUtils
Contains various utility methods used for OCR.
Constructor Summary | |
---|---|
OcrUtils()
|
Method Summary | |
---|---|
static java.awt.image.BufferedImage |
blackAndGrayCleaning(java.awt.image.BufferedImage image)
This method cleans input image by replacing all pixels with RGB values from -4473925 (gray) to -1 (white) with white pixels and from -4473925 (gray) to -16777216 (black) with black pixels |
static java.awt.image.BufferedImage |
blackAndLightGrayCleaning(java.awt.image.BufferedImage image)
This method cleans input image by replacing all pixels with RGB values from -3092272 (light gray) to -1 (white) with white pixels and from -3092272 (light gray) to -16777216 (black) with black pixels |
static java.awt.image.BufferedImage |
blackAndWhiteCleaning(java.awt.image.BufferedImage image)
This method cleans input image by replacing all non black pixels with white pixels |
static java.awt.image.BufferedImage |
colorCleaning(java.awt.image.BufferedImage image,
int RGBcolor)
This method cleans input image by replacing all pixels with RGB values from RGBcolor input (the input color) to -1 (white) with white pixels and from RGBcolor input (the input color) to -16777216 (black) with black pixels |
static java.awt.image.BufferedImage |
createImageFromText(java.lang.String text,
java.awt.Font font)
Creates and returns image from the given text. |
static java.awt.image.BufferedImage |
cropImage(java.awt.image.BufferedImage image,
int x1,
int y1,
int x2,
int y2)
Crops (returns subimage) of specified input image at specified points. |
static java.util.Map<java.lang.String,FractionRgbData> |
getFractionRgbDataForImages(java.util.HashMap<java.lang.String,java.awt.image.BufferedImage> imagesData)
Returns RGB data for all input images |
static java.awt.image.BufferedImage |
loadAndCleanImage(java.io.File f)
This method loads the input Image and returns the cleaned version |
static java.awt.image.BufferedImage |
loadImage(java.io.File file)
Loads image from the file. |
static java.awt.image.BufferedImage |
resizeImage(java.awt.image.BufferedImage image,
int width,
int height)
Resize image to specified dimensions |
static java.awt.image.BufferedImage |
trimImage(java.awt.image.BufferedImage imageToTrim)
This method trims the input image and returns it as a BufferedImage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OcrUtils()
Method Detail |
---|
public static java.awt.image.BufferedImage blackAndWhiteCleaning(java.awt.image.BufferedImage image)
image
- - input image that will be cleaned
public static java.awt.image.BufferedImage blackAndGrayCleaning(java.awt.image.BufferedImage image)
image
- - input image that will be cleaned
public static java.awt.image.BufferedImage blackAndLightGrayCleaning(java.awt.image.BufferedImage image)
image
- - input image that will be cleaned
public static java.awt.image.BufferedImage colorCleaning(java.awt.image.BufferedImage image, int RGBcolor)
image
- - input image that will be cleanedRGBcolor
- - input RGB value of wanted color as reference for celaning
public static java.awt.image.BufferedImage loadAndCleanImage(java.io.File f) throws java.io.IOException
f
- - input file that will be loaded as image
java.io.IOException
- - if error occurs during loadingpublic static java.awt.image.BufferedImage loadImage(java.io.File file) throws java.io.IOException
file
- image file
java.io.IOException
public static java.awt.image.BufferedImage trimImage(java.awt.image.BufferedImage imageToTrim)
imageToTrim
- input image that will be trimed
public static java.awt.image.BufferedImage resizeImage(java.awt.image.BufferedImage image, int width, int height)
image
- image to resizewidth
- new image widthheight
- new image height
public static java.awt.image.BufferedImage cropImage(java.awt.image.BufferedImage image, int x1, int y1, int x2, int y2)
image
- image to cropx1
- top left x coordinatey1
- top left y coordinatex2
- bottom right x coordinatey2
- bottom right y coordinate
public static java.awt.image.BufferedImage createImageFromText(java.lang.String text, java.awt.Font font)
text
- input textfont
- text font
public static java.util.Map<java.lang.String,FractionRgbData> getFractionRgbDataForImages(java.util.HashMap<java.lang.String,java.awt.image.BufferedImage> imagesData)
imagesData
- data map with characters as keys and charcter images as values
|
Neuroph | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |