Search in sources :

Example 1 with ConfigHoughFoot

use of boofcv.factory.feature.detect.line.ConfigHoughFoot in project BoofCV by lessthanoptimal.

the class VisualizeHoughFoot method process.

public void process(BufferedImage image) {
    I input = GeneralizedImageOps.createSingleBand(imageType, image.getWidth(), image.getHeight());
    I blur = GeneralizedImageOps.createSingleBand(imageType, image.getWidth(), image.getHeight());
    ConvertBufferedImage.convertFromSingle(image, input, imageType);
    GBlurImageOps.gaussian(input, blur, -1, 2, null);
    DetectLineHoughFoot<I, D> alg = FactoryDetectLineAlgs.houghFoot(new ConfigHoughFoot(6, 12, 5, 25, 10), imageType, derivType);
    ImageLinePanel gui = new ImageLinePanel();
    gui.setBackground(image);
    gui.setLines(alg.detect(blur));
    gui.setPreferredSize(new Dimension(image.getWidth(), image.getHeight()));
    BufferedImage renderedTran = VisualizeImageData.grayMagnitude(alg.getTransform().getTransform(), null, -1);
    BufferedImage renderedBinary = VisualizeBinaryData.renderBinary(alg.getBinary(), false, null);
    ShowImages.showWindow(renderedBinary, "Detected Edges");
    ShowImages.showWindow(renderedTran, "Parameter Space");
    ShowImages.showWindow(gui, "Detected Lines");
}
Also used : ConfigHoughFoot(boofcv.factory.feature.detect.line.ConfigHoughFoot) ImageLinePanel(boofcv.gui.feature.ImageLinePanel) BufferedImage(java.awt.image.BufferedImage) ConvertBufferedImage(boofcv.io.image.ConvertBufferedImage)

Aggregations

ConfigHoughFoot (boofcv.factory.feature.detect.line.ConfigHoughFoot)1 ImageLinePanel (boofcv.gui.feature.ImageLinePanel)1 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)1 BufferedImage (java.awt.image.BufferedImage)1