public class ImageUtils
extends java.lang.Object
| 构造器和说明 |
|---|
ImageUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static java.awt.image.BufferedImage |
createWorkingCopy(java.awt.image.BufferedImage bimg)
Converts an image to a standard internal representation.
|
static java.awt.image.BufferedImage |
cropImage(java.awt.image.BufferedImage image,
int fromX,
int fromY,
int width,
int height) |
static java.awt.image.BufferedImage |
denoiseImage(java.awt.image.BufferedImage img)
Non-local means denoising.
|
static java.awt.image.BufferedImage |
differenceOfGaussians(java.awt.image.BufferedImage image) |
static java.awt.image.BufferedImage |
get8BitRGBImage(java.awt.image.BufferedImage bufferedImage)
Check if the image is fail safe for color based features that are actually using 8 bits per pixel RGB.
|
static java.awt.image.BufferedImage |
getGrayscaleImage(java.awt.image.BufferedImage image)
Converts an image to grey.
|
static void |
invertImage(java.awt.image.BufferedImage image)
Inverts a grey scale image.
|
static float[] |
makeGaussianKernel(int radius,
float sigma)
creates a Gaussian kernel for ConvolveOp for blurring an image
|
static java.awt.image.BufferedImage |
removeScratches(java.awt.image.BufferedImage img) |
static java.awt.image.BufferedImage |
scaleImage(java.awt.image.BufferedImage image,
int maxSideLength)
Scales down an image into a box of maxSideLength x maxSideLength.
|
static java.awt.image.BufferedImage |
scaleImage(java.awt.image.BufferedImage image,
int width,
int height)
Scale image to an arbitrary shape not retaining proportions and aspect ratio.
|
static java.awt.image.BufferedImage |
thresholdImage(java.awt.image.BufferedImage image,
int threshold)
Converts an image (RGB, RGBA, ... whatever) to a binary one based on given threshold
|
static java.awt.image.BufferedImage |
trimWhiteSpace(java.awt.image.BufferedImage img)
Trims the white border around an image.
|
static java.awt.image.BufferedImage |
trimWhiteSpace(java.awt.image.BufferedImage src,
java.awt.image.BufferedImage tgt,
int whiteThreshold,
int startTop,
int startRight,
int startBottom,
int startLeft) |
static java.awt.image.BufferedImage |
trimWhiteSpace(java.awt.image.BufferedImage img,
int whiteThreshold,
int startTop,
int startRight,
int startBottom,
int startLeft)
Trims the white border around an image.
|
public static java.awt.image.BufferedImage scaleImage(java.awt.image.BufferedImage image,
int maxSideLength)
image - the image to scale down. It remains untouched.maxSideLength - the maximum side length of the scaled down instance. Has to be > 0.public static java.awt.image.BufferedImage scaleImage(java.awt.image.BufferedImage image,
int width,
int height)
image - width - height - public static java.awt.image.BufferedImage cropImage(java.awt.image.BufferedImage image,
int fromX,
int fromY,
int width,
int height)
public static java.awt.image.BufferedImage getGrayscaleImage(java.awt.image.BufferedImage image)
image - public static void invertImage(java.awt.image.BufferedImage image)
image - public static java.awt.image.BufferedImage createWorkingCopy(java.awt.image.BufferedImage bimg)
bimg - public static java.awt.image.BufferedImage trimWhiteSpace(java.awt.image.BufferedImage img)
img - public static java.awt.image.BufferedImage trimWhiteSpace(java.awt.image.BufferedImage img,
int whiteThreshold,
int startTop,
int startRight,
int startBottom,
int startLeft)
img - public static java.awt.image.BufferedImage trimWhiteSpace(java.awt.image.BufferedImage src,
java.awt.image.BufferedImage tgt,
int whiteThreshold,
int startTop,
int startRight,
int startBottom,
int startLeft)
public static java.awt.image.BufferedImage denoiseImage(java.awt.image.BufferedImage img)
img - public static java.awt.image.BufferedImage removeScratches(java.awt.image.BufferedImage img)
public static float[] makeGaussianKernel(int radius,
float sigma)
radius - the radius, i.e. 5sigma - sigma, i.e. 1.4fpublic static java.awt.image.BufferedImage differenceOfGaussians(java.awt.image.BufferedImage image)
public static java.awt.image.BufferedImage thresholdImage(java.awt.image.BufferedImage image,
int threshold)
image - the image to convert. Remains untouched.threshold - the threshold in [0,255]public static java.awt.image.BufferedImage get8BitRGBImage(java.awt.image.BufferedImage bufferedImage)
bufferedImage -