Class SquareGraph
java.lang.Object
boofcv.alg.fiducial.calib.squares.SquareGraph
Used for constructing a graph of squares that form a regular grid. Each square can have one edge per side.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
acuteAngle
(SquareNode a, int sideA, SquareNode b, int sideB) Returns an angle between 0 and PI/4 which describes the difference in slope between the two sidesboolean
almostParallel
(SquareNode a, int sideA, SquareNode b, int sideB) Checks to see if the two sides are almost parallel to each other by looking at their acute angle.boolean
checkConnect
(SquareNode a, int indexA, SquareNode b, int indexB, double distance) Checks to see if the two nodes can be connected.static void
void
detachEdge
(SquareEdge edge) Removes the edge from the two nodes and recycles the data structureint
findSideIntersect
(SquareNode n, LineSegment2D_F64 line, Point2D_F64 intersection, LineSegment2D_F64 storage) Finds the side which intersects the line on the shape.double
void
reset()
void
setParallelThreshold
(double parallelThreshold)
-
Field Details
-
declaredEdges
-
unused
-
-
Constructor Details
-
SquareGraph
public SquareGraph()
-
-
Method Details
-
reset
public void reset() -
computeNodeInfo
-
detachEdge
Removes the edge from the two nodes and recycles the data structure -
findSideIntersect
public int findSideIntersect(SquareNode n, LineSegment2D_F64 line, Point2D_F64 intersection, LineSegment2D_F64 storage) Finds the side which intersects the line on the shape. The line is assumed to pass through the shape so if there is no intersection it is considered a bug -
checkConnect
Checks to see if the two nodes can be connected. If one of the nodes is already connected to another it then checks to see if the proposed connection is more desirable. If it is the old connection is removed and a new one created. Otherwise nothing happens.- Returns:
- true if a connection is made
-
almostParallel
Checks to see if the two sides are almost parallel to each other by looking at their acute angle. -
acuteAngle
Returns an angle between 0 and PI/4 which describes the difference in slope between the two sides -
getParallelThreshold
public double getParallelThreshold() -
setParallelThreshold
public void setParallelThreshold(double parallelThreshold)
-