use of boofcv.gui.feature.ImageLinePanel in project BoofCV by lessthanoptimal.
the class ExampleLineDetection method detectLineSegments.
/**
* Detects segments inside the image
*
* @param image Input image.
* @param imageType Type of image processed by line detector.
*/
public static <T extends ImageGray<T>, D extends ImageGray<D>> void detectLineSegments(BufferedImage image, Class<T> imageType) {
// convert the line into a single band image
T input = ConvertBufferedImage.convertFromSingle(image, null, imageType);
// Comment/uncomment to try a different type of line detector
DetectLineSegment<T> detector = FactoryDetectLine.lineRansac(new ConfigLineRansac(40, 30, 2.36, true), imageType);
List<LineSegment2D_F32> found = detector.detect(input);
// display the results
ImageLinePanel gui = new ImageLinePanel();
gui.setImage(image);
gui.setLineSegments(found);
gui.setPreferredSize(new Dimension(image.getWidth(), image.getHeight()));
listPanel.addItem(gui, "Line Segments");
}
use of boofcv.gui.feature.ImageLinePanel in project BoofCV by lessthanoptimal.
the class ExampleLineDetection method detectLines.
private static <T extends ImageGray<T>> void detectLines(BufferedImage buffered, T gray, DetectLine<T> detector, String name) {
List<LineParametric2D_F32> found = detector.detect(gray);
// display the results
ImageLinePanel gui = new ImageLinePanel();
gui.setImage(buffered);
gui.setLines(found);
gui.setPreferredSize(new Dimension(gray.getWidth(), gray.getHeight()));
listPanel.addItem(gui, name);
}
Aggregations