Search in sources :

Example 41 with PathLabel

use of boofcv.io.PathLabel in project BoofCV by lessthanoptimal.

the class VisualizePyramidFloatApp method main.

public static void main(String[] args) {
    // VisualizePyramidFloatApp<GrayF32> app = new VisualizePyramidFloatApp<>(GrayF32.class);
    VisualizePyramidFloatApp<GrayU8> app = new VisualizePyramidFloatApp<>(GrayU8.class);
    java.util.List<PathLabel> inputs = new ArrayList<>();
    inputs.add(new PathLabel("boat", UtilIO.pathExample("standard/boat.jpg")));
    inputs.add(new PathLabel("shapes", UtilIO.pathExample("shapes/shapes01.png")));
    inputs.add(new PathLabel("sunflowers", UtilIO.pathExample("sunflowers.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 Float Pyramid", true);
}
Also used : PathLabel(boofcv.io.PathLabel) ArrayList(java.util.ArrayList) GrayU8(boofcv.struct.image.GrayU8)

Example 42 with PathLabel

use of boofcv.io.PathLabel in project BoofCV by lessthanoptimal.

the class WaveletVisualizeApp method main.

public static void main(String[] args) {
    BufferedImage in = UtilImageIO.loadImage("data/standard/lena512.bmp");
    WaveletVisualizeApp app = new WaveletVisualizeApp(GrayF32.class);
    // WaveletVisualizeApp app = new WaveletVisualizeApp(GrayU8.class);
    java.util.List<PathLabel> inputs = new ArrayList<>();
    inputs.add(new PathLabel("lena", UtilIO.pathExample("standard/lena512.jpg")));
    inputs.add(new PathLabel("boat", UtilIO.pathExample("standard/boat.jpg")));
    inputs.add(new PathLabel("fingerprint", UtilIO.pathExample("standard/fingerprint.jpg")));
    inputs.add(new PathLabel("shapes", UtilIO.pathExample("shapes/shapes01.png")));
    inputs.add(new PathLabel("sunflowers", UtilIO.pathExample("sunflowers.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, "Wavelet Transforms", true);
}
Also used : PathLabel(boofcv.io.PathLabel) ArrayList(java.util.ArrayList) BufferedImage(java.awt.image.BufferedImage) ConvertBufferedImage(boofcv.io.image.ConvertBufferedImage)

Example 43 with PathLabel

use of boofcv.io.PathLabel in project BoofCV by lessthanoptimal.

the class DemonstrationBase method createMenuBar.

private void createMenuBar(boolean openFile, boolean openWebcam, List<?> exampleInputs) {
    menuBar = new JMenuBar();
    JMenu menuFile = new JMenu("File");
    menuFile.setMnemonic(KeyEvent.VK_F);
    menuBar.add(menuFile);
    ActionListener listener = createActionListener();
    if (openFile) {
        this.menuItemFile = new JMenuItem("Open File");
        BoofSwingUtil.setMenuItemKeys(menuItemFile, KeyEvent.VK_O, KeyEvent.VK_O);
        this.menuItemFile.addActionListener(listener);
        menuFile.add(this.menuItemFile);
        JMenuItem menuItemNext = new JMenuItem("Open Next File");
        BoofSwingUtil.setMenuItemKeys(menuItemNext, KeyEvent.VK_N, KeyEvent.VK_I);
        menuItemNext.addActionListener(e -> openNextFile());
        menuFile.add(menuItemNext);
        menuRecent = new JMenu("Open Recent");
        menuFile.add(menuRecent);
        updateRecentItems();
    }
    if (openWebcam) {
        menuItemWebcam = new JMenuItem("Open Webcam");
        BoofSwingUtil.setMenuItemKeys(menuItemWebcam, KeyEvent.VK_W, KeyEvent.VK_W);
        menuItemWebcam.addActionListener(listener);
        menuFile.add(menuItemWebcam);
    }
    menuItenQuit = new JMenuItem("Quit", KeyEvent.VK_Q);
    menuItenQuit.addActionListener(listener);
    BoofSwingUtil.setMenuItemKeys(menuItenQuit, KeyEvent.VK_Q, KeyEvent.VK_Q);
    menuFile.addSeparator();
    menuFile.add(menuItenQuit);
    if (exampleInputs != null && exampleInputs.size() > 0) {
        JMenu menuExamples = new JMenu("Examples");
        menuExamples.setMnemonic(KeyEvent.VK_E);
        menuBar.add(menuExamples);
        for (final Object o : exampleInputs) {
            String name;
            if (o instanceof PathLabel) {
                name = ((PathLabel) o).getLabel();
            } else if (o instanceof String) {
                name = new File((String) o).getName();
            } else {
                name = o.toString();
            }
            JMenuItem menuItem = new JMenuItem(name);
            menuItem.addActionListener(e -> openExample(o));
            menuExamples.add(menuItem);
        }
    }
}
Also used : PathLabel(boofcv.io.PathLabel) ActionListener(java.awt.event.ActionListener) File(java.io.File)

Example 44 with PathLabel

use of boofcv.io.PathLabel in project BoofCV by lessthanoptimal.

the class DemonstrationBase method openExample.

/**
 * Function that is invoked when an example has been selected
 */
public void openExample(Object o) {
    String path;
    if (o instanceof PathLabel) {
        path = ((PathLabel) o).getPath();
    } else if (o instanceof String) {
        path = (String) o;
    } else {
        throw new IllegalArgumentException("Unknown example object type.  Please override openExample()");
    }
    openFile(new File(path));
}
Also used : PathLabel(boofcv.io.PathLabel) File(java.io.File)

Example 45 with PathLabel

use of boofcv.io.PathLabel in project BoofCV by lessthanoptimal.

the class VisualizeDepthVisualOdometryApp method main.

public static void main(String[] args) throws FileNotFoundException {
    List<PathLabel> inputs = new ArrayList<>();
    inputs.add(new PathLabel("Circle", UtilIO.pathExample("kinect/circle/config.txt")));
    inputs.add(new PathLabel("Hallway", UtilIO.pathExample("kinect/straight/config.txt")));
    VisualizeDepthVisualOdometryApp app = new VisualizeDepthVisualOdometryApp(inputs);
    app.openFile(new File(inputs.get(0).getPath()));
    app.waitUntilInputSizeIsKnown();
    ShowImages.showWindow(app, "Depth Visual Odometry", true);
}
Also used : PathLabel(boofcv.io.PathLabel) ArrayList(java.util.ArrayList)

Aggregations

PathLabel (boofcv.io.PathLabel)51 ArrayList (java.util.ArrayList)48 GrayF32 (boofcv.struct.image.GrayF32)14 File (java.io.File)10 ImageType (boofcv.struct.image.ImageType)7 GrayU8 (boofcv.struct.image.GrayU8)4 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)3 BufferedImage (java.awt.image.BufferedImage)3 BufferedReader (java.io.BufferedReader)2 IOException (java.io.IOException)2 SquareImage_to_FiducialDetector (boofcv.abst.fiducial.SquareImage_to_FiducialDetector)1 LensDistortionRadialTangential (boofcv.alg.distort.radtan.LensDistortionRadialTangential)1 ConfigFiducialBinary (boofcv.factory.fiducial.ConfigFiducialBinary)1 ConfigFiducialImage (boofcv.factory.fiducial.ConfigFiducialImage)1 ConfigThreshold (boofcv.factory.filter.binary.ConfigThreshold)1 StereoParameters (boofcv.struct.calib.StereoParameters)1 ActionListener (java.awt.event.ActionListener)1 FileReader (java.io.FileReader)1 Reader (java.io.Reader)1 List (java.util.List)1