Search in sources :

Example 11 with ImageInterleaved

use of boofcv.struct.image.ImageInterleaved in project BoofCV by lessthanoptimal.

the class TestConvolveImageStandard_IL method testMethod.

/**
 * Using the method's name and the number of parameters invoke the appropriate test function
 */
private void testMethod(Method m) {
    Class[] param = m.getParameterTypes();
    ImageInterleaved input = GeneralizedImageOps.createInterleaved(param[1], width, height, numBands);
    ImageInterleaved output = GeneralizedImageOps.createInterleaved(param[2], width, height, numBands);
    GImageMiscOps.fillUniform(input, rand, 1, maxPixelValue);
    if (m.getName().contentEquals("horizontal")) {
        if (param.length == 3) {
            BoofTesting.checkSubImage(this, "horizontal", true, input, output);
        } else {
            BoofTesting.checkSubImage(this, "horizontalDiv", true, input, output);
        }
    } else if (m.getName().contentEquals("vertical")) {
        if (param.length == 3) {
            BoofTesting.checkSubImage(this, "vertical", true, input, output);
        } else {
            BoofTesting.checkSubImage(this, "verticalDiv", true, input, output);
        }
    } else if (m.getName().contentEquals("convolve")) {
        if (param.length == 3) {
            BoofTesting.checkSubImage(this, "convolve", true, input, output);
        } else {
            BoofTesting.checkSubImage(this, "convolveDiv", true, input, output);
        }
    } else {
        fail("Unknown method name: " + m.getName());
    }
}
Also used : ImageInterleaved(boofcv.struct.image.ImageInterleaved)

Example 12 with ImageInterleaved

use of boofcv.struct.image.ImageInterleaved in project BoofCV by lessthanoptimal.

the class TestConvolveJustBorder_General_IL method reformatForValidation.

@Override
protected Object[] reformatForValidation(Method m, Object[] targetParam) {
    Object[] ret = new Object[] { targetParam[0], targetParam[1], targetParam[2] };
    ImageInterleaved inputImage = (ImageInterleaved) ((ImageBorder) targetParam[1]).getImage();
    KernelBase kernel = (KernelBase) targetParam[0];
    computeBorder(kernel, m.getName());
    int borderW = borderX0 + borderX1;
    int borderH = borderY0 + borderY1;
    ret[1] = inputImage.createNew(width + borderW, height + borderH);
    ret[2] = ((ImageInterleaved) targetParam[2]).createNew(width + borderW, height + borderH);
    fillTestImage(inputImage, (ImageInterleaved) ret[1], borderX0, borderY0, borderX1, borderY1);
    return ret;
}
Also used : ImageInterleaved(boofcv.struct.image.ImageInterleaved) KernelBase(boofcv.struct.convolve.KernelBase)

Aggregations

ImageInterleaved (boofcv.struct.image.ImageInterleaved)12 FactoryGImageGray (boofcv.core.image.FactoryGImageGray)1 FactoryGImageMultiBand (boofcv.core.image.FactoryGImageMultiBand)1 GImageGray (boofcv.core.image.GImageGray)1 GImageMultiBand (boofcv.core.image.GImageMultiBand)1 KernelBase (boofcv.struct.convolve.KernelBase)1 ImageGray (boofcv.struct.image.ImageGray)1