use of boofcv.struct.feature.MatrixOfList in project BoofCV by lessthanoptimal.
the class TestConnectLinesGrid method checkAngleTolerance.
/**
* Makes sure the angle tolerance parameter is correctly set and processed
*/
@Test
public void checkAngleTolerance() {
MatrixOfList<LineSegment2D_F32> grid = new MatrixOfList<>(1, 1);
grid.get(0, 0).add(new LineSegment2D_F32(0, 0, 2, 0));
grid.get(0, 0).add(new LineSegment2D_F32(2, 0, 4, 4));
// have the tolerance be too tight
ConnectLinesGrid app = new ConnectLinesGrid(0.1, 1, 1);
app.process(grid);
assertEquals(2, grid.createSingleList().size());
// now make the tolerance broader
app = new ConnectLinesGrid(Math.PI, 1, 1);
app.process(grid);
assertEquals(1, grid.createSingleList().size());
}
Aggregations