Search in sources :

Example 31 with ImageType

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

the class EquirectangularCylinderApp method main.

public static void main(String[] args) {
    ImageType type = ImageType.pl(3, GrayU8.class);
    List<PathLabel> examples = new ArrayList<>();
    examples.add(new PathLabel("Half Dome 01", UtilIO.pathExample("spherical/equirectangular_half_dome_01.jpg")));
    examples.add(new PathLabel("Half Dome 02", UtilIO.pathExample("spherical/equirectangular_half_dome_02.jpg")));
    examples.add(new PathLabel("Glow Sticks", UtilIO.pathExample("spherical/equirectangular_glowsticks.jpg")));
    EquirectangularCylinderApp app = new EquirectangularCylinderApp(examples, type);
    app.openFile(new File(examples.get(0).getPath()));
    app.display("Equirectanglar to Cylindrical");
}
Also used : PathLabel(boofcv.io.PathLabel) ArrayList(java.util.ArrayList) File(java.io.File) ImageType(boofcv.struct.image.ImageType)

Example 32 with ImageType

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

the class FisheyePinholeApp method main.

public static void main(String[] args) {
    ImageType type = ImageType.pl(3, GrayU8.class);
    List<PathLabel> examples = new ArrayList<>();
    examples.add(new PathLabel("Dining Room", UtilIO.pathExample("fisheye/theta/front_table.jpg")));
    examples.add(new PathLabel("Hike", UtilIO.pathExample("fisheye/theta/front_hike.jpg")));
    FisheyePinholeApp app = new FisheyePinholeApp(examples, type);
    app.openFile(new File(examples.get(0).getPath()));
    app.display("Fisheye to Pinhole Camera");
}
Also used : PathLabel(boofcv.io.PathLabel) ArrayList(java.util.ArrayList) File(java.io.File) ImageType(boofcv.struct.image.ImageType)

Example 33 with ImageType

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

the class VisualizeHogDescriptorApp method main.

public static void main(String[] args) {
    List<String> examples = new ArrayList<>();
    examples.add(UtilIO.pathExample("segment/berkeley_horses.jpg"));
    examples.add(UtilIO.pathExample("segment/berkeley_man.jpg"));
    examples.add(UtilIO.pathExample("shapes/shapes01.png"));
    examples.add(UtilIO.pathExample("shapes/shapes02.png"));
    ImageType imageType = ImageType.single(GrayF32.class);
    VisualizeHogDescriptorApp app = new VisualizeHogDescriptorApp(examples, imageType);
    app.openFile(new File(examples.get(0)));
    app.display("Hog Descriptor Visualization");
}
Also used : ArrayList(java.util.ArrayList) File(java.io.File) ImageType(boofcv.struct.image.ImageType)

Example 34 with ImageType

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

the class VisualizeImageHogCellApp method main.

public static void main(String[] args) {
    List<String> examples = new ArrayList<>();
    examples.add(UtilIO.pathExample("shapes/shapes01.png"));
    examples.add(UtilIO.pathExample("shapes/shapes02.png"));
    examples.add(UtilIO.pathExample("segment/berkeley_horses.jpg"));
    examples.add(UtilIO.pathExample("segment/berkeley_man.jpg"));
    ImageType imageType = ImageType.single(GrayF32.class);
    VisualizeImageHogCellApp app = new VisualizeImageHogCellApp(examples, imageType);
    app.openFile(new File(examples.get(0)));
    app.display("Hog Descriptor Unnormalized Cell");
}
Also used : ArrayList(java.util.ArrayList) File(java.io.File) ImageType(boofcv.struct.image.ImageType)

Example 35 with ImageType

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

the class ExampleJCodecDisplayFrames method main.

public static void main(String[] args) {
    String fileName = UtilIO.pathExample("background/highway_bridge_jitter.mp4");
    ImageType type = ImageType.pl(3, GrayU8.class);
    // ImageType type = ImageType.single(GrayU8.class);
    // ImageType type = ImageType.pl(3, GrayF32.class);
    // ImageType type = ImageType.single(GrayF32.class);
    JCodecSimplified sequence = new JCodecSimplified<>(fileName, type);
    BufferedImage out;
    if (sequence.hasNext()) {
        ImageBase frame = sequence.next();
        out = new BufferedImage(frame.width, frame.height, BufferedImage.TYPE_INT_RGB);
        ConvertBufferedImage.convertTo(frame, out, false);
    } else {
        throw new RuntimeException("No first frame?!?!");
    }
    ImagePanel gui = new ImagePanel(out);
    ShowImages.showWindow(gui, "Video!", true);
    long totalNano = 0;
    while (sequence.hasNext()) {
        long before = System.nanoTime();
        ImageBase frame = sequence.next();
        totalNano += System.nanoTime() - before;
        ConvertBufferedImage.convertTo(frame, out, false);
        gui.repaint();
        try {
            Thread.sleep(22);
        } catch (InterruptedException e) {
        }
    }
    System.out.println("Only read FPS = " + (totalNano / 1000000.0) / sequence.getFrameNumber());
}
Also used : JCodecSimplified(boofcv.io.jcodec.JCodecSimplified) BufferedImage(java.awt.image.BufferedImage) ConvertBufferedImage(boofcv.io.image.ConvertBufferedImage) ImageBase(boofcv.struct.image.ImageBase) ImageType(boofcv.struct.image.ImageType) ImagePanel(boofcv.gui.image.ImagePanel)

Aggregations

ImageType (boofcv.struct.image.ImageType)36 Test (org.junit.Test)19 ImageBase (boofcv.struct.image.ImageBase)14 ArrayList (java.util.ArrayList)11 File (java.io.File)10 PathLabel (boofcv.io.PathLabel)7 BackgroundModelMoving (boofcv.alg.background.BackgroundModelMoving)4 Homography2D_F32 (georegression.struct.homography.Homography2D_F32)4 Se3_F64 (georegression.struct.se.Se3_F64)4 BufferedImage (java.awt.image.BufferedImage)4 GrayU8 (boofcv.struct.image.GrayU8)3 BackgroundModelStationary (boofcv.alg.background.BackgroundModelStationary)2 ConfigBackgroundBasic (boofcv.factory.background.ConfigBackgroundBasic)2 ConfigBackgroundGaussian (boofcv.factory.background.ConfigBackgroundGaussian)2 ConfigBackgroundGmm (boofcv.factory.background.ConfigBackgroundGmm)2 ImageGridPanel (boofcv.gui.image.ImageGridPanel)2 MediaManager (boofcv.io.MediaManager)2 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)2 SimpleImageSequence (boofcv.io.image.SimpleImageSequence)2 DefaultMediaManager (boofcv.io.wrapper.DefaultMediaManager)2