|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.aerith.misao.util.TriangleMatchingSolver
The TriangleMatchingSolver
is a class to solve
matching between two lists of (x,y) positions, based on the
triangles pattern matching.
Inner Class Summary | |
protected class |
TriangleMatchingSolver.TriangleMap
The TriangleMap represents a map of triangles
based on the ratio of edges. |
protected class |
TriangleMatchingSolver.TrianglePosition
The TrianglePosition represents a triangle with
function to get virtual (x,y) position on a TriangleMap . |
protected class |
TriangleMatchingSolver.TriGraph
The TriGraph represents a graph which has function
to create triangles from itself. |
protected class |
TriangleMatchingSolver.TriIndex
The TriIndex represents a set of three indexes in
the original list which expresses a triangle. |
Field Summary | |
protected double |
acceptable_ratio
The upper limit of ratio of the map function to judge proper. |
protected double |
best_score
The best score of the matching. |
protected double |
check_accuracy
The accuracy to judge a mapped position coincides with a position in the other list when to check if the calculated map function is proper. |
protected PositionList |
checklist1
The first list of (x,y) positions to check if the map function is proper. |
protected PositionList |
checklist2
The second list of (x,y) positions to check if the map function is proper. |
protected PositionList |
list1
The first list of (x,y) positions. |
protected PositionList |
list2
The second list of (x,y) positions. |
protected MonitorSet |
monitor_set
The set of monitors. |
protected double |
score_to_fail
The score to fail. |
protected double |
score_to_pass
The score to pass. |
protected int |
triangle_map_division_count
The number to divide the map of triangles, which is divided into triangle_map_division_count x triangle_map_division_count parts. |
protected double |
triangle_map_unit_ratio
The unit of ratio of the map of triangles, which must be greater than 1.0. |
protected int |
trigraph_search_step1
The number of steps to create triangles from the graph of first (x,y) list. |
protected int |
trigraph_search_step2
The number of steps to create triangles from the graph of second (x,y) list. |
Constructor Summary | |
TriangleMatchingSolver(PositionList list1,
PositionList list2)
Constructs a TriangleMatchingSolver with two lists
of (x,y) positions. |
Method Summary | |
void |
addMonitor(Monitor monitor)
Adds a monitor. |
double |
getScore()
Gets the matching score. |
void |
setAcceptableRatio(double ratio)
Sets the upper limit of ratio of the map function to judge proper. |
void |
setCheckAccuracy(double accuracy)
Sets the accuracy to judge a mapped position coincides with a position in the other list when to check if the calculated map function is proper. |
void |
setCheckList(PositionList list1,
PositionList list2)
Sets the first list of (x,y) positions to check if the map function is proper. |
void |
setScoreToFail(double score)
Sets the score to fail. |
void |
setScoreToPass(double score)
Sets the score to pass. |
void |
setTriangleMapDivisionParameters(int division_count,
double unit_ratio)
Sets the number to divide and the unit of ratio of the map of triangles. |
void |
setTriGraphSearchSteps(int step1,
int step2)
Sets the number of steps to create triangles from the two graphs of (x,y) lists. |
MapFunction |
solve()
Solves matching between the specified lists of (x,y) positions and returns a MapFunction which converts (x,y)
position in the first list to (x,y) position in the second list. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected PositionList list1
protected PositionList list2
protected PositionList checklist1
protected PositionList checklist2
protected MonitorSet monitor_set
protected int trigraph_search_step1
protected int trigraph_search_step2
protected int triangle_map_division_count
protected double triangle_map_unit_ratio
protected double score_to_pass
protected double score_to_fail
MatchingFailedException
is thrown.protected double acceptable_ratio
protected double check_accuracy
protected double best_score
Constructor Detail |
public TriangleMatchingSolver(PositionList list1, PositionList list2)
TriangleMatchingSolver
with two lists
of (x,y) positions.list1
- the first list of (x,y) positions.list2
- the second list of (x,y) positions.Method Detail |
public void addMonitor(Monitor monitor)
monitor
- the monitor.public void setCheckList(PositionList list1, PositionList list2)
list1
- the first list of (x,y).list2
- the second list of (x,y).public void setTriGraphSearchSteps(int step1, int step2)
public void setTriangleMapDivisionParameters(int division_count, double unit_ratio) throws java.lang.IllegalArgumentException
The map of triangles is divided into division_count x division_count parts. The unit of ratio must be greater than 1.0.
division_count
- the number to divide this map.unit_ratio
- the unit of ratio to divide.public void setScoreToPass(double score)
score
- the score to pass.public void setScoreToFail(double score)
MatchingFailedException
is thrown.score
- the score to fail.public void setAcceptableRatio(double ratio)
ratio
- the acceptable ratio.public void setCheckAccuracy(double accuracy)
accuracy
- the accuracy.public double getScore()
public MapFunction solve() throws MatchingFailedException
MapFunction
which converts (x,y)
position in the first list to (x,y) position in the second list.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |