Search in sources :

Example 1 with Point2D_I16

use of georegression.struct.point.Point2D_I16 in project BoofCV by lessthanoptimal.

the class GeneralToInterestMulti method detect.

@Override
public void detect(T input) {
    foundMin.reset();
    foundMax.reset();
    detector.detect(input, null);
    QueueCorner min = detector.getMinimums();
    for (int i = 0; i < min.size; i++) {
        Point2D_I16 p = min.get(i);
        foundMin.grow().set(p.x, p.y);
    }
    QueueCorner max = detector.getMaximums();
    for (int i = 0; i < max.size; i++) {
        Point2D_I16 p = max.get(i);
        foundMax.grow().set(p.x, p.y);
    }
}
Also used : Point2D_I16(georegression.struct.point.Point2D_I16) QueueCorner(boofcv.struct.QueueCorner)

Example 2 with Point2D_I16

use of georegression.struct.point.Point2D_I16 in project BoofCV by lessthanoptimal.

the class CompareFeatureExtractorApp method doProcess.

private synchronized void doProcess() {
    // System.out.println("radius "+radius+" min separation "+minSeparation+" thresholdFraction "+thresholdFraction+" numFeatures "+numFeatures);
    deriv.setInput(grayImage);
    D derivX = deriv.getDerivative(true);
    D derivY = deriv.getDerivative(false);
    D derivXX = deriv.getDerivative(true, true);
    D derivYY = deriv.getDerivative(false, false);
    D derivXY = deriv.getDerivative(true, false);
    // todo modifying buffered images which might be actively being displayed, could mess up swing
    intensityAlg.process(grayImage, derivX, derivY, derivXX, derivYY, derivXY);
    GrayF32 intensity = intensityAlg.getIntensity();
    intensityImage = VisualizeImageData.colorizeSign(intensityAlg.getIntensity(), null, ImageStatistics.maxAbs(intensity));
    float max = ImageStatistics.maxAbs(intensity);
    float threshold = max * thresholdFraction;
    NonMaxSuppression extractor = FactoryFeatureExtractor.nonmax(new ConfigExtract(minSeparation, threshold, radius, true));
    GeneralFeatureDetector<T, D> detector = new GeneralFeatureDetector<>(intensityAlg, extractor);
    detector.setMaxFeatures(numFeatures);
    detector.process(grayImage, derivX, derivY, derivXX, derivYY, derivXY);
    QueueCorner foundCorners = detector.getMaximums();
    render.reset();
    for (int i = 0; i < foundCorners.size(); i++) {
        Point2D_I16 p = foundCorners.get(i);
        render.addPoint(p.x, p.y, 3, Color.RED);
    }
    Graphics2D g2 = workImage.createGraphics();
    g2.drawImage(input, 0, 0, grayImage.width, grayImage.height, null);
    render.draw(g2);
    drawImage();
}
Also used : ConfigExtract(boofcv.abst.feature.detect.extract.ConfigExtract) NonMaxSuppression(boofcv.abst.feature.detect.extract.NonMaxSuppression) GrayF32(boofcv.struct.image.GrayF32) Point2D_I16(georegression.struct.point.Point2D_I16) QueueCorner(boofcv.struct.QueueCorner) GeneralFeatureDetector(boofcv.alg.feature.detect.interest.GeneralFeatureDetector) FactoryIntensityPoint(boofcv.factory.feature.detect.intensity.FactoryIntensityPoint)

Example 3 with Point2D_I16

use of georegression.struct.point.Point2D_I16 in project BoofCV by lessthanoptimal.

the class DetectPointsWithNoiseApp method setActiveAlgorithm.

@Override
public synchronized void setActiveAlgorithm(int indexFamily, String name, Object cookie) {
    if (input == null)
        return;
    // corrupt the input image
    corruptPanel.corruptImage(grayImage, corruptImage);
    final EasyGeneralFeatureDetector<T, D> det = (EasyGeneralFeatureDetector<T, D>) cookie;
    det.detect(corruptImage, null);
    render.reset();
    if (det.getDetector().isDetectMinimums()) {
        QueueCorner l = det.getMinimums();
        for (int i = 0; i < l.size; i++) {
            Point2D_I16 p = l.get(i);
            render.addPoint(p.x, p.y, 3, Color.BLUE);
        }
    }
    if (det.getDetector().isDetectMaximums()) {
        QueueCorner l = det.getMaximums();
        for (int i = 0; i < l.size; i++) {
            Point2D_I16 p = l.get(i);
            render.addPoint(p.x, p.y, 3, Color.RED);
        }
    }
    SwingUtilities.invokeLater(new Runnable() {

        public void run() {
            ConvertBufferedImage.convertTo(corruptImage, workImage, true);
            Graphics2D g2 = workImage.createGraphics();
            g2.setStroke(new BasicStroke(3));
            render.draw(g2);
            panel.repaint();
        }
    });
}
Also used : Point2D_I16(georegression.struct.point.Point2D_I16) QueueCorner(boofcv.struct.QueueCorner) EasyGeneralFeatureDetector(boofcv.alg.feature.detect.interest.EasyGeneralFeatureDetector) FactoryDetectPoint(boofcv.factory.feature.detect.interest.FactoryDetectPoint)

Example 4 with Point2D_I16

use of georegression.struct.point.Point2D_I16 in project BoofCV by lessthanoptimal.

the class DdaManagerGeneralPoint method detectFeatures.

@Override
public void detectFeatures(I input, FastQueue<Point2D_F64> locDst, FastQueue<Desc> featDst) {
    // detect features in the image
    detector.detect(input, null);
    describe.setImage(input);
    QueueCorner found = detector.getMaximums();
    // compute descriptors and populate results list
    descriptors.reset();
    locations.reset();
    for (int i = 0; i < found.size; i++) {
        Point2D_I16 p = found.get(i);
        Desc desc = descriptors.grow();
        if (describe.process(p.x, p.y, 0, scale, desc)) {
            Point2D_F64 loc = locations.grow();
            loc.set(p.x, p.y);
            describe.process(loc.x, loc.y, 0, scale, desc);
            featDst.add(desc);
            locDst.add(loc);
        } else {
            descriptors.removeTail();
        }
    }
}
Also used : TupleDesc(boofcv.struct.feature.TupleDesc) Point2D_I16(georegression.struct.point.Point2D_I16) QueueCorner(boofcv.struct.QueueCorner) Point2D_F64(georegression.struct.point.Point2D_F64) DescribeRegionPoint(boofcv.abst.feature.describe.DescribeRegionPoint)

Example 5 with Point2D_I16

use of georegression.struct.point.Point2D_I16 in project BoofCV by lessthanoptimal.

the class NonMaxLimiter method process.

/**
 * Extracts local max and/or min from the intensity image.  If more than the maximum features are found then
 * only the most intense ones will be returned
 * @param intensity Feature image intensity
 */
public void process(GrayF32 intensity) {
    originalMin.reset();
    originalMax.reset();
    nonmax.process(intensity, null, null, originalMin, originalMax);
    localExtreme.reset();
    for (int i = 0; i < originalMin.size; i++) {
        Point2D_I16 p = originalMin.get(i);
        float val = intensity.unsafe_get(p.x, p.y);
        localExtreme.grow().set(-val, false, p);
    }
    for (int i = 0; i < originalMax.size; i++) {
        Point2D_I16 p = originalMax.get(i);
        float val = intensity.unsafe_get(p.x, p.y);
        localExtreme.grow().set(val, true, p);
    }
    if (localExtreme.size > maxTotalFeatures) {
        QuickSelect.select(localExtreme.data, maxTotalFeatures, localExtreme.size);
        localExtreme.size = maxTotalFeatures;
    }
}
Also used : Point2D_I16(georegression.struct.point.Point2D_I16)

Aggregations

Point2D_I16 (georegression.struct.point.Point2D_I16)27 QueueCorner (boofcv.struct.QueueCorner)12 GrayF32 (boofcv.struct.image.GrayF32)7 ScalePoint (boofcv.struct.feature.ScalePoint)5 ConfigExtract (boofcv.abst.feature.detect.extract.ConfigExtract)3 NonMaxSuppression (boofcv.abst.feature.detect.extract.NonMaxSuppression)3 Test (org.junit.Test)3 ImageBorder_F32 (boofcv.core.image.border.ImageBorder_F32)2 FactoryIntensityPoint (boofcv.factory.feature.detect.intensity.FactoryIntensityPoint)2 FactoryDetectPoint (boofcv.factory.feature.detect.interest.FactoryDetectPoint)2 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)2 LineParametric2D_F32 (georegression.struct.line.LineParametric2D_F32)2 Point2D_F64 (georegression.struct.point.Point2D_F64)2 BufferedImage (java.awt.image.BufferedImage)2 DescribeRegionPoint (boofcv.abst.feature.describe.DescribeRegionPoint)1 ConfigGeneralDetector (boofcv.abst.feature.detect.interest.ConfigGeneralDetector)1 DetectorFastNaive (boofcv.alg.feature.detect.intensity.DetectorFastNaive)1 EasyGeneralFeatureDetector (boofcv.alg.feature.detect.interest.EasyGeneralFeatureDetector)1 GeneralFeatureDetector (boofcv.alg.feature.detect.interest.GeneralFeatureDetector)1 OrientationImageAverage (boofcv.alg.feature.orientation.OrientationImageAverage)1