Search in sources :

Example 61 with GrayS16

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

the class TestEasyGeneralFeatureDetector method checkExclude.

@Test
public void checkExclude() {
    Helper<GrayU8, GrayS16> detector = new Helper<>(true, true);
    EasyGeneralFeatureDetector<GrayU8, GrayS16> alg = new EasyGeneralFeatureDetector<>(detector, GrayU8.class, GrayS16.class);
    alg.detect(image, new QueueCorner(10));
    assertFalse(detector.excludeIsNull);
}
Also used : QueueCorner(boofcv.struct.QueueCorner) GrayS16(boofcv.struct.image.GrayS16) GrayU8(boofcv.struct.image.GrayU8) Test(org.junit.Test)

Example 62 with GrayS16

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

the class TestImplEnhanceFilter method sharpenInner4.

public void sharpenInner4(ImageGray input, ImageGray output) {
    ImageGray expected;
    GImageMiscOps.fillUniform(input, rand, 0, 10);
    if (input.getDataType().isInteger()) {
        BoofTesting.callStaticMethod(ImplEnhanceFilter.class, "sharpenInner4", input, output, 0, 255);
        expected = new GrayS16(input.width, input.height);
        ConvolveImageStandard_SB.convolve(ImplEnhanceFilter.kernelEnhance4_I32, (GrayU8) input, (GrayS16) expected);
        GPixelMath.boundImage(expected, 0, 255);
    } else {
        BoofTesting.callStaticMethod(ImplEnhanceFilter.class, "sharpenInner4", input, output, 0f, 255f);
        expected = new GrayF32(input.width, input.height);
        ConvolveImageStandard_SB.convolve(ImplEnhanceFilter.kernelEnhance4_F32, (GrayF32) input, (GrayF32) expected);
        GPixelMath.boundImage(expected, 0, 255);
    }
    BoofTesting.assertEqualsInner(expected, output, 1e-5, 1, 1, false);
    BoofTesting.checkBorderZero(output, 1);
}
Also used : GrayF32(boofcv.struct.image.GrayF32) GrayS16(boofcv.struct.image.GrayS16) ImageGray(boofcv.struct.image.ImageGray)

Example 63 with GrayS16

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

the class TestImplEnhanceFilter method sharpenInner8.

public void sharpenInner8(ImageGray input, ImageGray output) {
    ImageGray expected;
    GImageMiscOps.fillUniform(input, rand, 0, 10);
    if (input.getDataType().isInteger()) {
        BoofTesting.callStaticMethod(ImplEnhanceFilter.class, "sharpenInner8", input, output, 0, 255);
        expected = new GrayS16(input.width, input.height);
        ConvolveImageStandard_SB.convolve(ImplEnhanceFilter.kernelEnhance8_I32, (GrayU8) input, (GrayS16) expected);
        GPixelMath.boundImage(expected, 0, 255);
    } else {
        BoofTesting.callStaticMethod(ImplEnhanceFilter.class, "sharpenInner8", input, output, 0f, 255f);
        expected = new GrayF32(input.width, input.height);
        ConvolveImageStandard_SB.convolve(ImplEnhanceFilter.kernelEnhance8_F32, (GrayF32) input, (GrayF32) expected);
        GPixelMath.boundImage(expected, 0, 255);
    }
    BoofTesting.assertEqualsInner(expected, output, 1e-5, 1, 1, false);
    BoofTesting.checkBorderZero(output, 1);
}
Also used : GrayF32(boofcv.struct.image.GrayF32) GrayS16(boofcv.struct.image.GrayS16) ImageGray(boofcv.struct.image.ImageGray)

Aggregations

GrayS16 (boofcv.struct.image.GrayS16)63 GrayU8 (boofcv.struct.image.GrayU8)45 Test (org.junit.Test)39 ImageBorder_S32 (boofcv.core.image.border.ImageBorder_S32)15 GrayF32 (boofcv.struct.image.GrayF32)13 Random (java.util.Random)8 CompareDerivativeToConvolution (boofcv.alg.filter.derivative.CompareDerivativeToConvolution)7 BorderIndex1D_Extend (boofcv.core.image.border.BorderIndex1D_Extend)4 ImageBorder1D_S32 (boofcv.core.image.border.ImageBorder1D_S32)4 ImageGray (boofcv.struct.image.ImageGray)4 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)3 BufferedImage (java.awt.image.BufferedImage)3 WrapDisparitySadRect (boofcv.abst.feature.disparity.WrapDisparitySadRect)2 DisparitySelect (boofcv.alg.feature.disparity.DisparitySelect)2 ImageBorder_F32 (boofcv.core.image.border.ImageBorder_F32)2 ListDisplayPanel (boofcv.gui.ListDisplayPanel)2 Kernel1D_S32 (boofcv.struct.convolve.Kernel1D_S32)2 FDistort (boofcv.abst.distort.FDistort)1 DetectLineSegmentsGridRansac (boofcv.abst.feature.detect.line.DetectLineSegmentsGridRansac)1 EdgeContour (boofcv.alg.feature.detect.edge.EdgeContour)1