Search in sources :

Example 56 with GrayU8

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

the class FiducialTrackerDemoApp method main.

public static void main(String[] args) {
    // Class type = GrayF32.class;
    Class type = GrayU8.class;
    java.util.List<PathLabel> inputs = new ArrayList<>();
    inputs.add(new PathLabel(SQUARE_NUMBER, UtilIO.pathExample("fiducial/binary/movie.mjpeg")));
    inputs.add(new PathLabel(SQUARE_PICTURE, UtilIO.pathExample("fiducial/image/video/movie.mjpeg")));
    inputs.add(new PathLabel(CALIB_CHESS, UtilIO.pathExample("fiducial/chessboard/movie.mjpeg")));
    inputs.add(new PathLabel(CALIB_SQUARE_GRID, UtilIO.pathExample("fiducial/square_grid/movie.mp4")));
    // inputs.add(new PathLabel(CALIB_SQUARE_BINARY_GRID, UtilIO.pathExample("fiducial/binary_grid/movie.mp4")));
    inputs.add(new PathLabel(CALIB_CIRCLE_HEXAGONAL_GRID, UtilIO.pathExample("fiducial/circle_hexagonal/movie.mp4")));
    inputs.add(new PathLabel(CALIB_CIRCLE_REGULAR_GRID, UtilIO.pathExample("fiducial/circle_regular/movie.mp4")));
    FiducialTrackerDemoApp app = new FiducialTrackerDemoApp(inputs, type);
    app.openExample(inputs.get(0));
    app.display("Fiducial Demonstrations");
}
Also used : PathLabel(boofcv.io.PathLabel) ArrayList(java.util.ArrayList) GrayU8(boofcv.struct.image.GrayU8)

Example 57 with GrayU8

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

the class ShowImageBlurApp method main.

public static void main(String[] args) {
    // ShowImageBlurApp<GrayF32> app = new ShowImageBlurApp<>(GrayF32.class);
    ShowImageBlurApp<GrayU8> app = new ShowImageBlurApp<>(GrayU8.class);
    java.util.List<PathLabel> inputs = new ArrayList<>();
    inputs.add(new PathLabel("shapes", UtilIO.pathExample("shapes/shapes01.png")));
    inputs.add(new PathLabel("sunflowers", UtilIO.pathExample("sunflowers.jpg")));
    inputs.add(new PathLabel("beach", UtilIO.pathExample("scale/beach02.jpg")));
    app.setInputList(inputs);
    // wait for it to process one image so that the size isn't all screwed up
    while (!app.getHasProcessedImage()) {
        Thread.yield();
    }
    ShowImages.showWindow(app, "Image Blur", true);
}
Also used : PathLabel(boofcv.io.PathLabel) ArrayList(java.util.ArrayList) GrayU8(boofcv.struct.image.GrayU8)

Example 58 with GrayU8

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

the class VisualizeFlipRotate method main.

public static void main(String[] args) {
    BufferedImage input = UtilImageIO.loadImage(UtilIO.pathExample("sunflowers.jpg"));
    GrayU8 gray = ConvertBufferedImage.convertFrom(input, (GrayU8) null);
    GrayU8 flipH = gray.clone();
    GrayU8 flipV = gray.clone();
    GrayU8 rotateCW = new GrayU8(gray.height, gray.width);
    GrayU8 rotateCCW = new GrayU8(gray.height, gray.width);
    ImageMiscOps.flipHorizontal(flipH);
    ImageMiscOps.flipVertical(flipV);
    ImageMiscOps.rotateCW(gray, rotateCW);
    ImageMiscOps.rotateCCW(gray, rotateCCW);
    ShowImages.showWindow(gray, "Input");
    ShowImages.showWindow(flipH, "Flip Horizontal");
    ShowImages.showWindow(flipV, "Flip Vertical");
    ShowImages.showWindow(rotateCW, "Rotate CW");
    ShowImages.showWindow(rotateCCW, "Rotate CCW");
}
Also used : GrayU8(boofcv.struct.image.GrayU8) BufferedImage(java.awt.image.BufferedImage) ConvertBufferedImage(boofcv.io.image.ConvertBufferedImage)

Example 59 with GrayU8

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

the class DerivativeHelperFunctions method processBorderVertical.

public static void processBorderVertical(GrayU8 orig, GrayS32 deriv, Kernel1D_S32 kernel, ImageBorder_S32 borderType) {
    borderType.setImage(orig);
    ConvolveJustBorder_General_SB.vertical(kernel, borderType, deriv);
    GrayU8 origSub;
    GrayS32 derivSub;
    origSub = orig.subimage(0, 0, 2, orig.height, null);
    derivSub = deriv.subimage(0, 0, 2, orig.height, null);
    ConvolveImageNoBorder.vertical(kernel, origSub, derivSub);
    origSub = orig.subimage(orig.width - 2, 0, orig.width, orig.height, null);
    derivSub = deriv.subimage(orig.width - 2, 0, orig.width, orig.height, null);
    ConvolveImageNoBorder.vertical(kernel, origSub, derivSub);
}
Also used : GrayU8(boofcv.struct.image.GrayU8) GrayS32(boofcv.struct.image.GrayS32)

Example 60 with GrayU8

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

the class TestImplIntegralImageOps method convolve.

public void convolve(Method m) throws InvocationTargetException, IllegalAccessException {
    Kernel2D_S32 kernel = new Kernel2D_S32(3, new int[] { 1, 1, 1, 2, 2, 2, 1, 1, 1 });
    GrayU8 input = new GrayU8(width, height);
    GrayS32 expected = new GrayS32(width, height);
    GImageMiscOps.fillUniform(input, rand, 0, 10);
    ImageBorder_S32 border = FactoryImageBorderAlgs.value(input, 0);
    ConvolveImage.convolve(kernel, input, expected, border);
    Class[] paramType = m.getParameterTypes();
    Class inputType = paramType[0];
    Class outputType = paramType[2];
    ImageGray inputII = GeneralizedImageOps.createSingleBand(inputType, width, height);
    ImageGray integral = GeneralizedImageOps.createSingleBand(outputType, width, height);
    ImageGray expectedII = GeneralizedImageOps.createSingleBand(outputType, width, height);
    ImageGray found = GeneralizedImageOps.createSingleBand(outputType, width, height);
    GConvertImage.convert(input, inputII);
    GConvertImage.convert(expected, expectedII);
    GIntegralImageOps.transform(inputII, integral);
    IntegralKernel kernelII = new IntegralKernel(2);
    kernelII.blocks[0] = new ImageRectangle(-2, -2, 1, 1);
    kernelII.blocks[1] = new ImageRectangle(-2, -1, 1, 0);
    kernelII.scales = new int[] { 1, 1 };
    m.invoke(null, integral, kernelII, found);
    BoofTesting.assertEqualsRelative(expected, found, 1e-4f);
}
Also used : Kernel2D_S32(boofcv.struct.convolve.Kernel2D_S32) IntegralKernel(boofcv.alg.transform.ii.IntegralKernel) ImageRectangle(boofcv.struct.ImageRectangle) GrayU8(boofcv.struct.image.GrayU8) GImageGray(boofcv.core.image.GImageGray) FactoryGImageGray(boofcv.core.image.FactoryGImageGray) ImageGray(boofcv.struct.image.ImageGray) ImageBorder_S32(boofcv.core.image.border.ImageBorder_S32) GrayS32(boofcv.struct.image.GrayS32)

Aggregations

GrayU8 (boofcv.struct.image.GrayU8)417 Test (org.junit.Test)242 BufferedImage (java.awt.image.BufferedImage)53 GrayS32 (boofcv.struct.image.GrayS32)52 GrayF32 (boofcv.struct.image.GrayF32)49 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)48 GrayS16 (boofcv.struct.image.GrayS16)45 Planar (boofcv.struct.image.Planar)28 ArrayList (java.util.ArrayList)22 File (java.io.File)17 ListDisplayPanel (boofcv.gui.ListDisplayPanel)16 RectangleLength2D_I32 (georegression.struct.shapes.RectangleLength2D_I32)16 ImageGray (boofcv.struct.image.ImageGray)15 EllipseRotated_F64 (georegression.struct.curve.EllipseRotated_F64)15 Random (java.util.Random)14 Point2D_F64 (georegression.struct.point.Point2D_F64)11 ImageRectangle (boofcv.struct.ImageRectangle)10 GrayU16 (boofcv.struct.image.GrayU16)10 Se3_F64 (georegression.struct.se.Se3_F64)10 Point3D_F64 (georegression.struct.point.Point3D_F64)9