public class SimilarityUtils
extends java.lang.Object
修飾子とタイプ | メソッドと説明 |
---|---|
static double |
calcFeatureDistance(java.awt.Color[][] expectedFeature,
java.awt.Color[][] actualFeature)
Calculate the distance of two feature matrices.
|
static SimilarityUnit |
calcSimilarity(java.awt.image.BufferedImage expectedImage,
java.awt.image.BufferedImage actualImage,
java.awt.Rectangle rectangle,
ComparedRectangleArea similarRectangle,
Offset offset)
calculate similarity of given rectangle area and offset And then, build similarRectangle using similarity values.
|
static SimilarityUnit |
calcSimilarity(java.awt.image.BufferedImage expectedImage,
java.awt.image.BufferedImage actualImage,
java.awt.Rectangle rectangle,
ComparedRectangleArea similarRectangle,
Offset offset,
double similarityFeatureMatrix)
calculate similarity of given rectangle area and offset, but similarityFeatureMatrix is given.
|
static double |
calcSimilarityByFeatureMatrix(java.awt.image.BufferedImage expectedImage,
java.awt.image.BufferedImage actualImage,
java.awt.Rectangle rectangle,
Offset offset)
Calculate the similarity using feature matrix and find the best match where it has the highest similarity This
method should be implemented only when the size of actualSubImage is greater than or equal to FeatureCol by
FeatureRow.
|
static double |
calcSimilarityByFeatureMatrix(java.awt.image.BufferedImage expectedImage,
java.awt.image.BufferedImage actualImage,
java.awt.Rectangle expectedFrame,
java.awt.Rectangle actualFrame)
Calculate the similarity using feature matrix using fixed frames of expected and actual images.
|
static SimilarityUnit |
calcSimilarityPixelByPixel(java.awt.image.BufferedImage expectedImage,
java.awt.image.BufferedImage actualImage,
java.awt.Rectangle rectangle,
Offset offset)
Calculate the similarity by comparing two images pixel by pixel, and find the best match where it has the highest
similarity (when given offset is null).
|
static boolean |
checkFeatureSize(int width,
int height)
Check if the size of rectangle is large enough to use feature method.
|
public static SimilarityUnit calcSimilarity(java.awt.image.BufferedImage expectedImage, java.awt.image.BufferedImage actualImage, java.awt.Rectangle rectangle, ComparedRectangleArea similarRectangle, Offset offset)
expectedImage
- actualImage
- rectangle
- similarRectangle
- offset
- public static SimilarityUnit calcSimilarity(java.awt.image.BufferedImage expectedImage, java.awt.image.BufferedImage actualImage, java.awt.Rectangle rectangle, ComparedRectangleArea similarRectangle, Offset offset, double similarityFeatureMatrix)
expectedImage
- actualImage
- rectangle
- similarRectangle
- offset
- similarityFeatureMatrix
- in the case of "SCALING", we use similarity already calculated. in the other
cases, it has -1.public static double calcFeatureDistance(java.awt.Color[][] expectedFeature, java.awt.Color[][] actualFeature)
expectedFeature
- The feature matrix of expected sub imageactualFeature
- The feature matrix of actual sub imagepublic static boolean checkFeatureSize(int width, int height)
width
- the width of compared rectangleheigth
- the height of compared rectanglepublic static double calcSimilarityByFeatureMatrix(java.awt.image.BufferedImage expectedImage, java.awt.image.BufferedImage actualImage, java.awt.Rectangle rectangle, Offset offset)
expectedImage
- actualImage
- rectangle
- The rectangle area to be compared of actual image.public static double calcSimilarityByFeatureMatrix(java.awt.image.BufferedImage expectedImage, java.awt.image.BufferedImage actualImage, java.awt.Rectangle expectedFrame, java.awt.Rectangle actualFrame)
expectedImage
- actualImage
- expectedFrame
- the rectangle area to be extracted feature vector in expectedImageactualFrame
- the rectangle area to be extracted feature vector in actualImagepublic static SimilarityUnit calcSimilarityPixelByPixel(java.awt.image.BufferedImage expectedImage, java.awt.image.BufferedImage actualImage, java.awt.Rectangle rectangle, Offset offset)
expectedSubImage
- the sub-image of given rectangle area of expected imageactualSubImage
- the sub-image of given 'template' rectangle area of actual image. it is smaller than
expectedSubImage.rectangle
- The rectangle area where to compare.similarityUnit
- offset
- best match offset. If default offset is given, don't find the best match.