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