Search in sources :

Example 6 with GrayS16

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

the class BenchmarkConvertImage method main.

public static void main(String[] args) {
    imgSInt8 = new GrayU8(imgWidth, imgHeight);
    imgSInt16 = new GrayS16(imgWidth, imgHeight);
    imgUInt8 = new GrayU8(imgWidth, imgHeight);
    imgUInt16 = new GrayS16(imgWidth, imgHeight);
    imgFloat32 = new GrayF32(imgWidth, imgHeight);
    System.out.println("=========  Profile Image Size " + imgWidth + " x " + imgHeight + " ==========");
    System.out.println();
    System.out.printf("Float32 to Int8              %10.2f ops/sec\n", ProfileOperation.profileOpsPerSec(new Float32toInt8(), 1000, false));
    System.out.printf("Int8 to Float32 signed       %10.2f ops/sec\n", ProfileOperation.profileOpsPerSec(new Int8ToFloat32(imgSInt8), 1000, false));
    System.out.printf("Int8 to Float32 unsigned     %10.2f ops/sec\n", ProfileOperation.profileOpsPerSec(new Int8ToFloat32(imgUInt8), 1000, false));
    System.out.printf("Int16 to Float32 signed       %10.2f ops/sec\n", ProfileOperation.profileOpsPerSec(new Int16ToFloat32(imgSInt16), 1000, false));
    System.out.printf("Int16 to Float32 unsigned     %10.2f ops/sec\n", ProfileOperation.profileOpsPerSec(new Int16ToFloat32(imgUInt16), 1000, false));
    System.out.printf("Int16 to Int8 signed          %10.2f ops/sec\n", ProfileOperation.profileOpsPerSec(new Int16ToInt8(imgSInt16), 1000, false));
    System.out.printf("Int16 to Int8 unsigned        %10.2f ops/sec\n", ProfileOperation.profileOpsPerSec(new Int16ToInt8(imgUInt16), 1000, false));
}
Also used : GrayF32(boofcv.struct.image.GrayF32) GrayS16(boofcv.struct.image.GrayS16) GrayU8(boofcv.struct.image.GrayU8)

Example 7 with GrayS16

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

the class TestGradientThree method compareToConvolve_I16.

@Test
public void compareToConvolve_I16() throws NoSuchMethodException {
    CompareDerivativeToConvolution validator = new CompareDerivativeToConvolution();
    validator.setTarget(GradientThree.class.getMethod("process", GrayS16.class, GrayS16.class, GrayS16.class, ImageBorder_S32.class));
    validator.setKernel(0, GradientThree.kernelDeriv_I32, true);
    validator.setKernel(1, GradientThree.kernelDeriv_I32, false);
    GrayS16 input = new GrayS16(width, height);
    ImageMiscOps.fillUniform(input, rand, 0, 10);
    GrayS16 derivX = new GrayS16(width, height);
    GrayS16 derivY = new GrayS16(width, height);
    validator.compare(input, derivX, derivY);
}
Also used : GrayS16(boofcv.struct.image.GrayS16) ImageBorder_S32(boofcv.core.image.border.ImageBorder_S32) Test(org.junit.Test)

Example 8 with GrayS16

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

the class TestGradientTwo0 method compareToConvolve_I16.

@Test
public void compareToConvolve_I16() throws NoSuchMethodException {
    CompareDerivativeToConvolution validator = new CompareDerivativeToConvolution();
    validator.setTarget(GradientTwo0.class.getMethod("process", GrayS16.class, GrayS16.class, GrayS16.class, ImageBorder_S32.class));
    validator.setKernel(0, GradientTwo0.kernelDeriv_I32, true);
    validator.setKernel(1, GradientTwo0.kernelDeriv_I32, false);
    GrayS16 input = new GrayS16(width, height);
    ImageMiscOps.fillUniform(input, rand, 0, 10);
    GrayS16 derivX = new GrayS16(width, height);
    GrayS16 derivY = new GrayS16(width, height);
    validator.compare(input, derivX, derivY);
}
Also used : GrayS16(boofcv.struct.image.GrayS16) ImageBorder_S32(boofcv.core.image.border.ImageBorder_S32) Test(org.junit.Test)

Example 9 with GrayS16

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

the class TestGradientTwo0 method compareToConvolve_I8.

@Test
public void compareToConvolve_I8() throws NoSuchMethodException {
    CompareDerivativeToConvolution validator = new CompareDerivativeToConvolution();
    validator.setTarget(GradientTwo0.class.getMethod("process", GrayU8.class, GrayS16.class, GrayS16.class, ImageBorder_S32.class));
    validator.setKernel(0, GradientTwo0.kernelDeriv_I32, true);
    validator.setKernel(1, GradientTwo0.kernelDeriv_I32, false);
    GrayU8 input = new GrayU8(width, height);
    ImageMiscOps.fillUniform(input, rand, 0, 10);
    GrayS16 derivX = new GrayS16(width, height);
    GrayS16 derivY = new GrayS16(width, height);
    validator.compare(input, derivX, derivY);
}
Also used : GrayS16(boofcv.struct.image.GrayS16) GrayU8(boofcv.struct.image.GrayU8) ImageBorder_S32(boofcv.core.image.border.ImageBorder_S32) Test(org.junit.Test)

Example 10 with GrayS16

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

the class TestHessianFromGradient method hessianSobel_I8.

@Test
public void hessianSobel_I8() throws NoSuchMethodException {
    CompareHessianToConvolution validator = new CompareHessianToConvolution();
    validator.setTarget(HessianFromGradient.class.getMethod("hessianSobel", GrayS16.class, GrayS16.class, GrayS16.class, GrayS16.class, GrayS16.class, ImageBorder_S32.class));
    validator.setKernel(0, GradientSobel.kernelDerivX_I32);
    validator.setKernel(1, GradientSobel.kernelDerivY_I32);
    GrayS16 derivX = new GrayS16(width, height);
    GrayS16 derivY = new GrayS16(width, height);
    ImageMiscOps.fillUniform(derivX, rand, -10, 10);
    ImageMiscOps.fillUniform(derivY, rand, -10, 10);
    GrayS16 derivXX = new GrayS16(width, height);
    GrayS16 derivYY = new GrayS16(width, height);
    GrayS16 derivXY = new GrayS16(width, height);
    validator.compare(derivX, derivY, derivXX, derivYY, derivXY);
}
Also used : GrayS16(boofcv.struct.image.GrayS16) ImageBorder_S32(boofcv.core.image.border.ImageBorder_S32) Test(org.junit.Test)

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