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");
}
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);
}
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");
}
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);
}
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);
}
Aggregations