use of boofcv.struct.image.ImageGray in project BoofCV by lessthanoptimal.
the class TestImplEnhanceFilter method sharpenBorder8.
/**
* Compare the sharpen filter to a bounded convolution
*/
@Test
public void sharpenBorder8() {
int numFound = 0;
Method[] methods = ImplEnhanceFilter.class.getMethods();
for (int i = 0; i < methods.length; i++) {
if (methods[i].getName().compareTo("sharpenBorder8") != 0)
continue;
numFound++;
Class imageType = methods[i].getParameterTypes()[0];
ImageGray input = GeneralizedImageOps.createSingleBand(imageType, width, height);
ImageGray output = GeneralizedImageOps.createSingleBand(imageType, width, height);
sharpenBorder8(input, output);
BoofTesting.checkSubImage(this, "sharpenBorder8", true, input, output);
}
assertEquals(2, numFound);
}
use of boofcv.struct.image.ImageGray in project BoofCV by lessthanoptimal.
the class TestImplEnhanceFilter method sharpenInner4.
/**
* Compare the sharpen filter to a bounded convolution
*/
@Test
public void sharpenInner4() {
int numFound = 0;
Method[] methods = ImplEnhanceFilter.class.getMethods();
for (int i = 0; i < methods.length; i++) {
if (methods[i].getName().compareTo("sharpenInner4") != 0)
continue;
numFound++;
Class imageType = methods[i].getParameterTypes()[0];
ImageGray input = GeneralizedImageOps.createSingleBand(imageType, width, height);
ImageGray output = GeneralizedImageOps.createSingleBand(imageType, width, height);
sharpenInner4(input, output);
BoofTesting.checkSubImage(this, "sharpenInner4", true, input, output);
}
assertEquals(2, numFound);
}
use of boofcv.struct.image.ImageGray in project BoofCV by lessthanoptimal.
the class TestImplEnhanceFilter method sharpenInner8.
/**
* Compare the sharpen filter to a bounded convolution
*/
@Test
public void sharpenInner8() {
int numFound = 0;
Method[] methods = ImplEnhanceFilter.class.getMethods();
for (int i = 0; i < methods.length; i++) {
if (methods[i].getName().compareTo("sharpenInner8") != 0)
continue;
numFound++;
Class imageType = methods[i].getParameterTypes()[0];
ImageGray input = GeneralizedImageOps.createSingleBand(imageType, width, height);
ImageGray output = GeneralizedImageOps.createSingleBand(imageType, width, height);
sharpenInner8(input, output);
BoofTesting.checkSubImage(this, "sharpenInner8", true, input, output);
}
assertEquals(2, numFound);
}
use of boofcv.struct.image.ImageGray in project BoofCV by lessthanoptimal.
the class TestImplEnhanceHistogram method applyTransform.
@Test
public void applyTransform() {
int numFound = 0;
Method[] methods = ImplEnhanceHistogram.class.getMethods();
for (int i = 0; i < methods.length; i++) {
if (methods[i].getName().compareTo("applyTransform") != 0)
continue;
numFound++;
Class imageType = methods[i].getParameterTypes()[0];
ImageGray input = GeneralizedImageOps.createSingleBand(imageType, width, height);
ImageGray output = GeneralizedImageOps.createSingleBand(imageType, width, height);
applyTransform(input, output);
BoofTesting.checkSubImage(this, "applyTransform", true, input, output);
}
assertEquals(5, numFound);
}
use of boofcv.struct.image.ImageGray in project BoofCV by lessthanoptimal.
the class TestImplGrayImageOps method stretch.
public void stretch(Method m) throws InvocationTargetException, IllegalAccessException {
Class[] param = m.getParameterTypes();
ImageGray input = GeneralizedImageOps.createSingleBand(param[0], width, height);
ImageGray output = GeneralizedImageOps.createSingleBand(param[0], width, height);
GImageMiscOps.fill(input, 23);
m.invoke(null, input, 2.5, 10, 255, output);
GImageGray b = FactoryGImageGray.wrap(output);
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
if (output.getDataType().isInteger())
assertEquals(67, b.get(x, y).doubleValue(), 1e-4);
else
assertEquals(67.5, b.get(x, y).doubleValue(), 1e-4);
}
}
// check to see how well it sets the ceiling
m.invoke(null, input, 10, 28, 255, output);
assertEquals(255, b.get(5, 6).doubleValue(), 1e-4);
// check it flooring to zero
m.invoke(null, input, -1, 2, 255, output);
assertEquals(0, b.get(5, 6).doubleValue(), 1e-4);
}
Aggregations