net.aerith.misao.pixy.matching
Class DefaultMatchingSolver

java.lang.Object
  |
  +--net.aerith.misao.util.OperationObservable
        |
        +--net.aerith.misao.util.Operation
              |
              +--net.aerith.misao.pixy.matching.DefaultMatchingSolver

public class DefaultMatchingSolver
extends Operation

The DefaultMatchingSolver is a class to solve matching between two lists of stars. Only some bright stars are used in matching. In general, the first list must contain the detected stars, and the second list must contain the catalog data. And the map area of the second list is 4 times of that of the first list.


Inner Class Summary
protected  class DefaultMatchingSolver.MatchingPositionMap
          The MatchingPositionMap represents a rectangular map of StarPositions.
 
Field Summary
protected  double check_accuracy
          The accuracy to judge a mapped position of a detected star coincides with a position of a catalog data.
protected  MapFunction map_function
          The map function to convert (x,y) position in the first list to (x,y) position in the second list.
protected  MatchingFailedException matching_failed_exception
          The exception thrown when matching is failed.
protected  int mode
          The mode.
static int MODE_IMAGE_TO_CATALOG
          The mode number which represents the matching between the detected stars and the catalog data.
static int MODE_IMAGE_TO_IMAGE
          The mode number which represents the matching between the detected stars and the detected stars.
protected  PositionMap original_map1
          The first list of stars and the area.
protected  PositionMap original_map2
          The second list of stars and the area.
protected  double score
          The matching score.
 
Fields inherited from class net.aerith.misao.util.Operation
monitor_set, stopped
 
Fields inherited from class net.aerith.misao.util.OperationObservable
observer_list
 
Constructor Summary
DefaultMatchingSolver(PositionMap map1, PositionMap map2)
          Constructs a DefaultMatchingSolver with two lists of stars and the area.
 
Method Summary
 MapFunction getMapFunction()
          Gets the map function to convert (x,y) position in the first list to (x,y) position in the second list.
 double getScore()
          Gets the matching score.
 void operate()
          Operates.
 boolean ready()
          Returns true if the operation is ready to start.
 void setCheckAccuracy(double accuracy)
          Sets the accuracy to judge a mapped position of a detected star coincides with a position of a catalog data.
 void setMode(int m)
          Sets the mode.
 
Methods inherited from class net.aerith.misao.util.Operation
addMonitor, isStopped, perform, run, stop
 
Methods inherited from class net.aerith.misao.util.OperationObservable
addObserver, deleteObserver, notifyEnd, notifyFailed, notifyStart, notifySucceeded, notifyWarned
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

original_map1

protected PositionMap original_map1
The first list of stars and the area.

original_map2

protected PositionMap original_map2
The second list of stars and the area.

map_function

protected MapFunction map_function
The map function to convert (x,y) position in the first list to (x,y) position in the second list.

mode

protected int mode
The mode.

MODE_IMAGE_TO_CATALOG

public static final int MODE_IMAGE_TO_CATALOG
The mode number which represents the matching between the detected stars and the catalog data.

MODE_IMAGE_TO_IMAGE

public static final int MODE_IMAGE_TO_IMAGE
The mode number which represents the matching between the detected stars and the detected stars.

check_accuracy

protected double check_accuracy
The accuracy to judge a mapped position of a detected star coincides with a position of a catalog data.

score

protected double score
The matching score.

matching_failed_exception

protected MatchingFailedException matching_failed_exception
The exception thrown when matching is failed.
Constructor Detail

DefaultMatchingSolver

public DefaultMatchingSolver(PositionMap map1,
                             PositionMap map2)
Constructs a DefaultMatchingSolver with two lists of stars and the area. In general, the first list must contain the detected stars, and the second list must contain the catalog data.
Parameters:
map1 - the first list of stars and the area.
map2 - the second list of stars and the area.
Method Detail

getMapFunction

public MapFunction getMapFunction()
                           throws MatchingFailedException
Gets the map function to convert (x,y) position in the first list to (x,y) position in the second list.
Returns:
the map function to convert (x,y) position in the first list to (x,y) position in the second list.
Throws:
MatchingFailedException - if the best score after all searches is less than the specified score to fail.

setMode

public void setMode(int m)
Sets the mode.
Parameters:
m - the mode.

setCheckAccuracy

public void setCheckAccuracy(double accuracy)
Sets the accuracy to judge a mapped position of a detected star coincides with a position of a catalog data.
Parameters:
accuracy - the accuracy.

getScore

public double getScore()
Gets the matching score.
Returns:
the matching score.

ready

public boolean ready()
Returns true if the operation is ready to start.
Overrides:
ready in class Operation
Returns:
true if the operation is ready to start.

operate

public void operate()
             throws java.lang.Exception
Operates.
Overrides:
operate in class Operation
Throws:
java.lang.Exception - if an error occurs.