use of boofcv.struct.image.GrayU8 in project BoofCV by lessthanoptimal.
the class TestHessianThree method compareToConvolve_I8.
// @Test
// public void checkInputShape() {
// GenericDerivativeTests.checkImageDimensionValidation(new HessianThree(), 2);
// }
@Test
public void compareToConvolve_I8() throws NoSuchMethodException {
CompareDerivativeToConvolution validator = new CompareDerivativeToConvolution();
validator.setTarget(HessianThree.class.getMethod("process", GrayU8.class, GrayS16.class, GrayS16.class, GrayS16.class, ImageBorder_S32.class));
validator.setKernel(0, HessianThree.kernelXXYY_I32, true);
validator.setKernel(1, HessianThree.kernelXXYY_I32, false);
validator.setKernel(2, HessianThree.kernelCross_I32);
GrayU8 input = new GrayU8(width, height);
ImageMiscOps.fillUniform(input, rand, 0, 10);
GrayS16 derivXX = new GrayS16(width, height);
GrayS16 derivYY = new GrayS16(width, height);
GrayS16 derivXY = new GrayS16(width, height);
validator.compare(input, derivXX, derivYY, derivXY);
}
use of boofcv.struct.image.GrayU8 in project BoofCV by lessthanoptimal.
the class TestGradientSobel_Naive method compareToKnown_I8.
/**
* Compare the results to a hand computed value
*/
@Test
public void compareToKnown_I8() {
GrayU8 img = new GrayU8(width, height);
ImageMiscOps.fillUniform(img, rand, 0, 100);
GrayS16 derivX = new GrayS16(width, height);
GrayS16 derivY = new GrayS16(width, height);
BoofTesting.checkSubImage(this, "compareToKnown_I8", true, img, derivX, derivY);
}
use of boofcv.struct.image.GrayU8 in project BoofCV by lessthanoptimal.
the class TestConvolveNormalizedStandardSparse method computeExpected.
private float computeExpected(GrayU8 image) {
GrayU8 temp = new GrayU8(image.width, image.height);
GrayU8 temp2 = new GrayU8(image.width, image.height);
ConvolveImageNormalized.horizontal(kernelI32, image, temp);
ConvolveImageNormalized.vertical(kernelI32, temp, temp2);
return temp2.get(targetX, targetY);
}
use of boofcv.struct.image.GrayU8 in project BoofCV by lessthanoptimal.
the class TestImageLineIntegral method isInside.
@Test
public void isInside() {
GrayU8 img = new GrayU8(12, 14);
alg.setImage(FactoryGImageGray.wrap(img));
assertTrue(alg.isInside(0, 0));
assertTrue(alg.isInside(12, 14));
assertTrue(alg.isInside(12, 0));
assertTrue(alg.isInside(0, 14));
assertFalse(alg.isInside(-0.0001, 0));
assertFalse(alg.isInside(0, -0.00001));
assertFalse(alg.isInside(12.000001, 14));
assertFalse(alg.isInside(12, 14.0001));
assertFalse(alg.isInside(12.0001, 0));
assertFalse(alg.isInside(0, 14.00001));
}
use of boofcv.struct.image.GrayU8 in project BoofCV by lessthanoptimal.
the class TestImageLineIntegral method across_SlopeZero.
/**
* Test cases where the slope for x or y is zero across multiple pixels
*/
@Test
public void across_SlopeZero() {
GrayU8 img = new GrayU8(10, 15);
img.set(6, 6, 100);
img.set(6, 7, 50);
img.set(6, 8, 10);
img.set(7, 6, 50);
img.set(8, 6, 10);
alg.setImage(FactoryGImageGray.wrap(img));
checkSolution(6.5, 6, 6.5, 8, 150);
checkSolution(6.5, 6, 6.5, 7.5, 125);
checkSolution(6.5, 6.5, 6.5, 8, 100);
checkSolution(6.5, 6.5, 6.5, 7.5, 75);
checkSolution(6.5, 6, 6.5, 8.5, 155);
checkSolution(6, 6.5, 8, 6.5, 150);
checkSolution(6, 6.5, 7.5, 6.5, 125);
checkSolution(6.5, 6.5, 8, 6.5, 100);
checkSolution(6.5, 6.5, 7.5, 6.5, 75);
checkSolution(6, 6.5, 8.5, 6.5, 155);
}
Aggregations