public class BoofTesting
extends java.lang.Object
| Constructor and Description |
|---|
BoofTesting() |
| Modifier and Type | Method and Description |
|---|---|
static void |
assertEquals(byte[] a,
byte[] b) |
static void |
assertEquals(double[] a,
double[] b,
double tol) |
static void |
assertEquals(double[] a,
float[] b,
double tol) |
static void |
assertEquals(double[] a,
int[] b) |
static void |
assertEquals(float[] a,
float[] b,
float tol) |
static void |
assertEquals(boofcv.struct.image.ImageBase imgA,
boofcv.struct.image.ImageBase imgB,
double tol) |
static void |
assertEquals(int[] a,
int[] b) |
static void |
assertEquals(long[] a,
long[] b) |
static void |
assertEquals(short[] a,
short[] b) |
static void |
assertEqualsBorder(boofcv.struct.image.ImageGray imgA,
boofcv.struct.image.ImageGray imgB,
double tol,
int borderX,
int borderY)
Checks to see if only the image borders are equal to each other within tolerance
|
static void |
assertEqualsInner(boofcv.struct.image.ImageBase imgA,
boofcv.struct.image.ImageBase imgB,
double tol,
int borderX,
int borderY,
boolean relative) |
static void |
assertEqualsInner(boofcv.struct.image.ImageBase imgA,
boofcv.struct.image.ImageBase imgB,
double tol,
int borderX0,
int borderY0,
int borderX1,
int borderY1,
boolean relative) |
static void |
assertEqualsRelative(boofcv.struct.image.ImageBase imgA,
boofcv.struct.image.ImageBase imgB,
double tolFrac) |
static void |
callStaticMethod(java.lang.Class<?> classType,
java.lang.String name,
java.lang.Object... inputs)
Looks up the static method then passes in the specified inputs.
|
static void |
checkBorderZero(boofcv.struct.image.ImageGray outputImage,
int border) |
static void |
checkBorderZero(boofcv.struct.image.ImageGray outputImage,
int borderX0,
int borderY0,
int borderX1,
int borderY1) |
static void |
checkImageDimensionReshape(java.lang.Object testClass,
int numFunctions)
Searches for functions that accept only images and makes sure they only accept
images which have he same width and height.
|
static void |
checkImageDimensionValidation(java.lang.Object testClass,
int numFunctions)
Searches for functions that accept only images and makes sure they only accept
images which have he same width and height.
|
static void |
checkSubImage(java.lang.Object testClass,
java.lang.String function,
boolean checkEquals,
java.lang.Object... inputParam)
Tests the specified function with the original image provided and with an equivalent
sub-image.
|
static <T> T |
convertToGenericType(java.lang.Class<?> type) |
static boofcv.struct.image.ImageDataType |
convertToGenericType(boofcv.struct.image.ImageDataType type) |
static java.lang.Object |
createInstance(java.lang.Class type) |
static <T extends boofcv.struct.image.ImageInterleaved<T>> |
createSubImageOf_I(T input) |
static <T extends boofcv.struct.image.Planar> |
createSubImageOf_PL(T input) |
static <T extends boofcv.struct.image.ImageGray<T>> |
createSubImageOf_S(T input) |
static <T extends boofcv.struct.image.ImageBase<T>> |
createSubImageOf(T input)
Returns an image which is a sub-image but contains the same values of the input image.
|
static boofcv.concurrency.WorkArrays |
createWorkArray(java.lang.Class type,
int length) |
static java.lang.reflect.Method |
findMethod(java.lang.Class<?> type,
java.lang.String name,
java.lang.Class<?>... params)
Searches for a function which is a perfect match.
|
static int |
findMethodThenCall(java.lang.Object owner,
java.lang.String ownerMethod,
java.lang.Class target,
java.lang.String targetMethod)
Searches for all functions with the specified name in the target class.
|
static java.lang.Object |
primitive(java.lang.Object v,
java.lang.Class type) |
static void |
printDiff(boofcv.struct.image.ImageGray imgA,
boofcv.struct.image.ImageGray imgB) |
static void |
printDiffBinary(boofcv.struct.image.GrayU8 imgA,
boofcv.struct.image.GrayU8 imgB) |
static java.lang.Object |
randomArray(java.lang.Class type,
int length,
java.util.Random rand) |
public static <T> T convertToGenericType(java.lang.Class<?> type)
public static boofcv.struct.image.ImageDataType convertToGenericType(boofcv.struct.image.ImageDataType type)
public static <T extends boofcv.struct.image.ImageBase<T>> T createSubImageOf(T input)
Returns an image which is a sub-image but contains the same values of the input image. Use for testing compliance with sub-images. The subimage is created by creating a larger image, copying over the input image into the inner portion, then creating a subimage of the copied part.
public static <T extends boofcv.struct.image.ImageGray<T>> T createSubImageOf_S(T input)
public static <T extends boofcv.struct.image.ImageInterleaved<T>> T createSubImageOf_I(T input)
public static <T extends boofcv.struct.image.Planar> T createSubImageOf_PL(T input)
public static void checkImageDimensionValidation(java.lang.Object testClass,
int numFunctions)
testClass - Instance of the class being testedpublic static void checkImageDimensionReshape(java.lang.Object testClass,
int numFunctions)
testClass - Instance of the class being testedpublic static void checkSubImage(java.lang.Object testClass,
java.lang.String function,
boolean checkEquals,
java.lang.Object... inputParam)
GrayU8.testClass - Instance of the class that contains the function being tested.function - The name of the function being tested.checkEquals - Checks to see if the two images have been modified the same way on outputinputParam - The original input parameterspublic static java.lang.reflect.Method findMethod(java.lang.Class<?> type,
java.lang.String name,
java.lang.Class<?>... params)
public static void callStaticMethod(java.lang.Class<?> classType,
java.lang.String name,
java.lang.Object... inputs)
public static int findMethodThenCall(java.lang.Object owner,
java.lang.String ownerMethod,
java.lang.Class target,
java.lang.String targetMethod)
owner - ownerMethod - target - targetMethod - public static void assertEquals(double[] a,
double[] b,
double tol)
public static void assertEquals(double[] a,
float[] b,
double tol)
public static void assertEquals(double[] a,
int[] b)
public static void assertEquals(byte[] a,
byte[] b)
public static void assertEquals(short[] a,
short[] b)
public static void assertEquals(int[] a,
int[] b)
public static void assertEquals(long[] a,
long[] b)
public static void assertEquals(float[] a,
float[] b,
float tol)
public static void assertEquals(boofcv.struct.image.ImageBase imgA,
boofcv.struct.image.ImageBase imgB,
double tol)
public static void assertEqualsInner(boofcv.struct.image.ImageBase imgA,
boofcv.struct.image.ImageBase imgB,
double tol,
int borderX,
int borderY,
boolean relative)
public static void assertEqualsInner(boofcv.struct.image.ImageBase imgA,
boofcv.struct.image.ImageBase imgB,
double tol,
int borderX0,
int borderY0,
int borderX1,
int borderY1,
boolean relative)
public static void assertEqualsRelative(boofcv.struct.image.ImageBase imgA,
boofcv.struct.image.ImageBase imgB,
double tolFrac)
public static void assertEqualsBorder(boofcv.struct.image.ImageGray imgA,
boofcv.struct.image.ImageGray imgB,
double tol,
int borderX,
int borderY)
public static void checkBorderZero(boofcv.struct.image.ImageGray outputImage,
int border)
public static void checkBorderZero(boofcv.struct.image.ImageGray outputImage,
int borderX0,
int borderY0,
int borderX1,
int borderY1)
public static void printDiff(boofcv.struct.image.ImageGray imgA,
boofcv.struct.image.ImageGray imgB)
public static void printDiffBinary(boofcv.struct.image.GrayU8 imgA,
boofcv.struct.image.GrayU8 imgB)
public static java.lang.Object randomArray(java.lang.Class type,
int length,
java.util.Random rand)
public static java.lang.Object primitive(java.lang.Object v,
java.lang.Class type)
public static java.lang.Object createInstance(java.lang.Class type)
public static boofcv.concurrency.WorkArrays createWorkArray(java.lang.Class type,
int length)