Search in sources :

Example 6 with GrayS8

use of boofcv.struct.image.GrayS8 in project BoofCV by lessthanoptimal.

the class TestHysteresisEdgeTraceMark method standardTest.

private void standardTest(int which) {
    GrayF32 inten = intensity(which);
    GrayS8 dir = direction(which);
    GrayU8 out = new GrayU8(inten.width, inten.height);
    HysteresisEdgeTraceMark alg = new HysteresisEdgeTraceMark();
    alg.process(inten, dir, 2, 5, out);
    BoofTesting.assertEquals(expected(which), out, 0);
}
Also used : GrayF32(boofcv.struct.image.GrayF32) GrayS8(boofcv.struct.image.GrayS8) GrayU8(boofcv.struct.image.GrayU8)

Example 7 with GrayS8

use of boofcv.struct.image.GrayS8 in project BoofCV by lessthanoptimal.

the class TestHysteresisEdgeTracePoints method standardTest.

private void standardTest(int which) {
    GrayF32 inten = intensity(which);
    GrayS8 dir = direction(which);
    HysteresisEdgeTracePoints alg = new HysteresisEdgeTracePoints();
    alg.process(inten, dir, 2, 5);
    GrayU8 out = convert(alg.getContours(), inten.width, inten.height);
    BoofTesting.assertEquals(expected(which), out, 0);
}
Also used : GrayF32(boofcv.struct.image.GrayF32) GrayS8(boofcv.struct.image.GrayS8) GrayU8(boofcv.struct.image.GrayU8)

Example 8 with GrayS8

use of boofcv.struct.image.GrayS8 in project BoofCV by lessthanoptimal.

the class TestHysteresisEdgeTracePoints method test2.

@Test
public void test2() {
    GrayS8 dir = direction(2);
    HysteresisEdgeTracePoints alg = new HysteresisEdgeTracePoints();
    alg.process(intensity(2), dir, 3, 5);
    assertEquals(3, ImageStatistics.sum(convert(alg.getContours(), dir.width, dir.height)));
    alg.process(intensity(2), dir, 2, 5);
    assertEquals(4, ImageStatistics.sum(convert(alg.getContours(), dir.width, dir.height)));
}
Also used : GrayS8(boofcv.struct.image.GrayS8) Test(org.junit.Test)

Example 9 with GrayS8

use of boofcv.struct.image.GrayS8 in project BoofCV by lessthanoptimal.

the class TestImplEdgeNonMaxSuppression method naive4.

@Test
public void naive4() {
    GrayF32 intensity = new GrayF32(3, 3);
    GrayF32 output = new GrayF32(3, 3);
    GrayS8 direction = new GrayS8(3, 3);
    // test it against simple positive and negative cases
    for (int dir = -1; dir < 3; dir++) {
        direction.set(1, 1, dir);
        GImageMiscOps.fill(intensity, 0);
        intensity.set(1, 1, 10);
        // test suppress
        setByDirection4(intensity, dir, 15);
        ImplEdgeNonMaxSuppression.naive4(intensity, direction, output);
        assertEquals(0, output.get(1, 1), 1e-4f);
        // test no suppression
        setByDirection4(intensity, dir, 5);
        ImplEdgeNonMaxSuppression.naive4(intensity, direction, output);
        assertEquals(intensity.get(1, 1), output.get(1, 1), 1e-4f);
    }
}
Also used : GrayF32(boofcv.struct.image.GrayF32) GrayS8(boofcv.struct.image.GrayS8) Test(org.junit.Test)

Example 10 with GrayS8

use of boofcv.struct.image.GrayS8 in project BoofCV by lessthanoptimal.

the class TestImplEdgeNonMaxSuppression method inner8.

@Test
public void inner8() {
    GrayF32 intensity = new GrayF32(width, height);
    GrayS8 direction = new GrayS8(width, height);
    GrayF32 expected = new GrayF32(width, height);
    GrayF32 found = new GrayF32(width, height);
    BoofTesting.checkSubImage(this, "inner8", true, intensity, direction, expected, found);
}
Also used : GrayF32(boofcv.struct.image.GrayF32) GrayS8(boofcv.struct.image.GrayS8) Test(org.junit.Test)

Aggregations

GrayS8 (boofcv.struct.image.GrayS8)21 GrayF32 (boofcv.struct.image.GrayF32)16 Test (org.junit.Test)16 GrayU8 (boofcv.struct.image.GrayU8)5 DescribeRegionPoint (boofcv.abst.feature.describe.DescribeRegionPoint)2 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)2 Planar (boofcv.struct.image.Planar)2 BufferedImage (java.awt.image.BufferedImage)2 HysteresisEdgeTraceMark (boofcv.alg.feature.detect.edge.HysteresisEdgeTraceMark)1 ConnectLinesGrid (boofcv.alg.feature.detect.line.ConnectLinesGrid)1 Edgel (boofcv.alg.feature.detect.line.gridline.Edgel)1 GridLineModelDistance (boofcv.alg.feature.detect.line.gridline.GridLineModelDistance)1 GridLineModelFitter (boofcv.alg.feature.detect.line.gridline.GridLineModelFitter)1 ImplGridRansacLineDetector_F32 (boofcv.alg.feature.detect.line.gridline.ImplGridRansacLineDetector_F32)1 ListDisplayPanel (boofcv.gui.ListDisplayPanel)1 ImageLinePanel (boofcv.gui.feature.ImageLinePanel)1 ModelManagerLinePolar2D_F32 (georegression.fitting.line.ModelManagerLinePolar2D_F32)1 LinePolar2D_F32 (georegression.struct.line.LinePolar2D_F32)1 LineSegment2D_F32 (georegression.struct.line.LineSegment2D_F32)1 Ransac (org.ddogleg.fitting.modelset.ransac.Ransac)1