|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectalgorithm.Matching2D
public class Matching2D
Wrapper class to use PSGM for the matching of 2D data. Takes care of
loading the data and reordering the skeletons, if needed.
PSGM is then applied to the two skeletons, where the end nodes of the
two skeletons are matched.
| Field Summary | |
|---|---|
private Config |
config
holding configuration parameters |
private org.apache.log4j.Logger |
logger
logger instance |
private boolean |
reordered
hold the information if the two skeletons were reordered for the algorithm, that is, PathSimilaritySkeletonGraphMatching.so1
originally was the second skeleton, and the other way around. |
private SkeletonObject |
so1
the first skeleton object (the one with lesser end nodes |
private SkeletonObject |
so1_flipped
the first skeleton object, read from an image flipped horizontally |
private SkeletonObject |
so2
the second skeleton object (the one with more end nodes |
| Constructor Summary | |
|---|---|
Matching2D(SkeletonObject so1,
SkeletonObject so1_flipped,
SkeletonObject so2,
Config config)
Constructor that should only be used if you know what you are doing. |
|
Matching2D(java.lang.String skeletonfilename1,
java.lang.String objectfilename1,
java.lang.String skeletonfilename2,
java.lang.String objectfilename2)
Constructor. |
|
Matching2D(java.lang.String skeletonfilename1,
java.lang.String objectfilename1,
java.lang.String skeletonfilename2,
java.lang.String objectfilename2,
Config config)
Constructor. |
|
Matching2D(java.lang.String skeletonfilename1,
java.lang.String objectfilename1,
java.lang.String skeletonfilename2,
java.lang.String objectfilename2,
java.lang.String[] args)
Constructor. |
|
| Method Summary | |
|---|---|
SkeletonObject |
getSo1_flipped()
Get the first skeleton (the one with lesser end nodes), but flipped horizontally) |
SkeletonObject |
getSo1()
Get the "first skeleton", the one with lesser end nodes. |
SkeletonObject |
getSo2()
Get the "second skeleton", the one with more end nodes |
CleanMatchingResult |
go()
execute the PSGM algorithm. |
boolean |
isReordered()
Test if the two skeletons were reordered in order to execute the algorithm. |
private void |
loadSkeletons(java.lang.String skeletonfilename1,
java.lang.String objectfilename1,
java.lang.String skeletonfilename2,
java.lang.String objectfilename2)
load both skeletons, specified by the filename. |
void |
setSo1_flipped(SkeletonObject so1_flipped)
Set the first skeleton (the one with lesser end nodes), but flipped horizontally) |
void |
setSo1(SkeletonObject so1)
Set the "first skeleton", the one with lesser end nodes. |
void |
setSo2(SkeletonObject so2)
Set the "second skeleton", the one with lesser end nodes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private SkeletonObject so1
private SkeletonObject so2
private SkeletonObject so1_flipped
private final Config config
private boolean reordered
PathSimilaritySkeletonGraphMatching.so1
originally was the second skeleton, and the other way around.
private final org.apache.log4j.Logger logger
| Constructor Detail |
|---|
public Matching2D(java.lang.String skeletonfilename1,
java.lang.String objectfilename1,
java.lang.String skeletonfilename2,
java.lang.String objectfilename2)
throws InvalidConfigParameterException,
java.io.IOException,
InvalidSkeletonException
Input of the algorithm are at minimum four input files. For each object to be matched, two input images are needed: One binary image showing the skeleton, one binary image showing the shape. Both binary images should have black background and white foreground.
skeletonfilename1 - the path to the first skeleton imageobjectfilename1 - the path to the first shape imageskeletonfilename2 - the path to the second skeleton imageobjectfilename2 - the path to the second shape image
InvalidConfigParameterException - if an error occured, creating the new config instance
java.io.IOException - if one of the input files could not be found
InvalidSkeletonException - if one of the skeletons was broken.
public Matching2D(java.lang.String skeletonfilename1,
java.lang.String objectfilename1,
java.lang.String skeletonfilename2,
java.lang.String objectfilename2,
java.lang.String[] args)
throws InvalidConfigParameterException,
java.io.IOException,
InvalidSkeletonException
Input of the algorithm are at minimum four input files. For each object to be matched, two input images are needed: One binary image showing the skeleton, one binary image showing the shape. Both binary images should have black background and white foreground.
When using this constructor, als a string array of config parameters can
be passed - see Config for more information.
skeletonfilename1 - the path to the first skeleton imageobjectfilename1 - the path to the first shape imageskeletonfilename2 - the path to the second skeleton imageobjectfilename2 - the path to the second shape imageargs - an array of configuration strings
InvalidConfigParameterException - if an error occured, creating the new config instance
java.io.IOException - if one of the input files could not be found
InvalidSkeletonException - if one of the skeletons was broken.
public Matching2D(java.lang.String skeletonfilename1,
java.lang.String objectfilename1,
java.lang.String skeletonfilename2,
java.lang.String objectfilename2,
Config config)
throws java.io.IOException,
InvalidSkeletonException,
InvalidConfigParameterException
Input of the algorithm are at minimum four input files. For each object to be matched, two input images are needed: One binary image showing the skeleton, one binary image showing the shape. Both binary images should have black background and white foreground.
If this constructor is used, also a configuration instance can be passed.
skeletonfilename1 - the path to the first skeleton imageobjectfilename1 - the path to the first shape imageskeletonfilename2 - the path to the second skeleton imageobjectfilename2 - the path to the second shape imageconfig - holding configration parameters
InvalidConfigParameterException - if an error occured with the config instance
java.io.IOException - if one of the input files could not be found
InvalidSkeletonException - if one of the skeletons was broken.
public Matching2D(SkeletonObject so1,
SkeletonObject so1_flipped,
SkeletonObject so2,
Config config)
throws InvalidSkeletonException,
WrongUsageOfAlgorithmException
so1 - the skeleton object with lesser end nodesso1_flipped - the first skeleton object, flipped horizontallyso2 - the skeleton object with more end nodesconfig - holding the configuration parameters
InvalidSkeletonException - if one of the skeleton seems to be broken
WrongUsageOfAlgorithmException - if the algorithm is applied in a wrong way| Method Detail |
|---|
private void loadSkeletons(java.lang.String skeletonfilename1,
java.lang.String objectfilename1,
java.lang.String skeletonfilename2,
java.lang.String objectfilename2)
throws java.io.IOException,
InvalidSkeletonException,
InvalidConfigParameterException
skeletonfilename1 - - path to the first skeleton imageobjectfilename1 - - path to the first shape image (belonging to
skeletonfilename1)skeletonfilename2 - - path to the second skeleton imageobjectfilename2 - - path to the second skeleton image (belonging to
skeletonfilename2)
java.io.IOException - - if one of the image was not found
InvalidSkeletonException - - if one of the skeletons seems broken
InvalidConfigParameterException
public CleanMatchingResult go()
throws InvalidSkeletonException,
InvalidWeightFunctionGivenException,
WrongUsageOfAlgorithmException,
InvalidConfigParameterException
PSGM algorithm. The matching result will be cleared,
that is, if the input skeleton were reordered in order to execute the
algorithm, they are ordered back, and if one of the shapes has been
flipped, the match list is "translated back" to the original image.
InvalidSkeletonException - if one of the skeleton seems to be broken
InvalidWeightFunctionGivenException - if no valid weight function could be extracted for the final
matching
WrongUsageOfAlgorithmException - if one of the steps in the algorithm has been applied wrong
InvalidConfigParameterException - if one of the configuration parameters is no valid valuepublic SkeletonObject getSo1()
public void setSo1(SkeletonObject so1)
so1 - the first skeleton objectpublic SkeletonObject getSo2()
public void setSo2(SkeletonObject so2)
so2 - the second skeleton to setpublic SkeletonObject getSo1_flipped()
public void setSo1_flipped(SkeletonObject so1_flipped)
so1_flipped - the so1_flipped to setpublic boolean isReordered()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||