Package com.irurueta.ar.epipolar
Class FundamentalMatrixComparator
java.lang.Object
com.irurueta.ar.epipolar.FundamentalMatrixComparator
- Direct Known Subclasses:
AlgebraicFundamentalMatrixComparator,EpipolarDistanceFundamentalMatrixComparator
Compares two fundamental matrices to determine how similar they are.
This is an abstract class, subclasses of this class will implement different
methods to compare fundamental matrices.
This class will typically be used for testing or quality assessment purposes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FundamentalMatrixFundamental matrix to be considered as ground truth to compare against.protected FundamentalMatrixComparatorListenerListener to handle events generated by this class.protected booleanIndicates whether this instance is busy doing computations.protected FundamentalMatrixOther fundamental matrix being compared. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor.protectedConstructor.protectedFundamentalMatrixComparator(FundamentalMatrix groundTruthFundamentalMatrix, FundamentalMatrix otherFundamentalMatrix) Constructor.protectedFundamentalMatrixComparator(FundamentalMatrix groundTruthFundamentalMatrix, FundamentalMatrix otherFundamentalMatrix, FundamentalMatrixComparatorListener listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionabstract doublecompare()Compares two fundamental matrices and returns the comparison value.Obtains fundamental matrix to be considered as ground truth to compare against.Returns listener to handle events generated by instances of this class.Obtains other fundamental matrix being compared.abstract FundamentalMatrixComparatorTypegetType()Returns type of comparator.booleanisLocked()Returns boolean indicating whether an instance of this class is busy doing computations.booleanisReady()Indicates whether this comparator is ready to start the comparison of two fundamental matrices.voidsetGroundTruthFundamentalMatrix(FundamentalMatrix groundTruthFundamentalMatrix) Sets fundamental matrix to be considered as ground truth to compare against.voidSets listener to handle events generated by instances of this class.voidsetOtherFundamentalMatrix(FundamentalMatrix otherFundamentalMatrix) Sets other fundamental matrix being compared.
-
Field Details
-
groundTruthFundamentalMatrix
Fundamental matrix to be considered as ground truth to compare against. -
otherFundamentalMatrix
Other fundamental matrix being compared. -
listener
Listener to handle events generated by this class. -
locked
protected boolean lockedIndicates whether this instance is busy doing computations.
-
-
Constructor Details
-
FundamentalMatrixComparator
protected FundamentalMatrixComparator()Constructor. -
FundamentalMatrixComparator
protected FundamentalMatrixComparator(FundamentalMatrix groundTruthFundamentalMatrix, FundamentalMatrix otherFundamentalMatrix) Constructor.- Parameters:
groundTruthFundamentalMatrix- fundamental matrix to be considered as ground truth to compare against.otherFundamentalMatrix- other fundamental matrix being compared.
-
FundamentalMatrixComparator
Constructor.- Parameters:
listener- listener to handle events generated by this class.
-
FundamentalMatrixComparator
protected FundamentalMatrixComparator(FundamentalMatrix groundTruthFundamentalMatrix, FundamentalMatrix otherFundamentalMatrix, FundamentalMatrixComparatorListener listener) Constructor.- Parameters:
groundTruthFundamentalMatrix- fundamental matrix to be considered as ground truth to compare against.otherFundamentalMatrix- other fundamental matrix being compared.listener- listener to handle events generated by this class.
-
-
Method Details
-
getGroundTruthFundamentalMatrix
Obtains fundamental matrix to be considered as ground truth to compare against.- Returns:
- fundamental matrix to be considered as ground truth.
-
setGroundTruthFundamentalMatrix
public void setGroundTruthFundamentalMatrix(FundamentalMatrix groundTruthFundamentalMatrix) throws com.irurueta.geometry.estimators.LockedException Sets fundamental matrix to be considered as ground truth to compare against.- Parameters:
groundTruthFundamentalMatrix- fundamental matrix to be considered as ground truth.- Throws:
com.irurueta.geometry.estimators.LockedException- if this instance is locked.
-
getOtherFundamentalMatrix
Obtains other fundamental matrix being compared.- Returns:
- other fundamental matrix being compared.
-
setOtherFundamentalMatrix
public void setOtherFundamentalMatrix(FundamentalMatrix otherFundamentalMatrix) throws com.irurueta.geometry.estimators.LockedException Sets other fundamental matrix being compared.- Parameters:
otherFundamentalMatrix- other fundamental matrix being compared.- Throws:
com.irurueta.geometry.estimators.LockedException- if this instance is locked.
-
getListener
Returns listener to handle events generated by instances of this class.- Returns:
- listener to handle events generated by instances of this class.
-
setListener
public void setListener(FundamentalMatrixComparatorListener listener) throws com.irurueta.geometry.estimators.LockedException Sets listener to handle events generated by instances of this class.- Parameters:
listener- listener to handle events generated by instances of this class.- Throws:
com.irurueta.geometry.estimators.LockedException- if this instance is locked.
-
isLocked
public boolean isLocked()Returns boolean indicating whether an instance of this class is busy doing computations.- Returns:
- true if this instance is locked, false otherwise.
-
isReady
public boolean isReady()Indicates whether this comparator is ready to start the comparison of two fundamental matrices. This is true when both ground truth and the other fundamental matrix has been provided and both have their internal matrices defined.- Returns:
- true if this comparator is ready, false otherwise.
-
compare
public abstract double compare() throws com.irurueta.geometry.estimators.NotReadyException, com.irurueta.geometry.estimators.LockedException, FundamentalMatrixComparatorExceptionCompares two fundamental matrices and returns the comparison value. Comparison value will depend on the method implemented to compare both fundamental matrices.- Returns:
- comparison value. Typically, the smaller the absolute value the more similar the fundamental matrices are.
- Throws:
com.irurueta.geometry.estimators.NotReadyException- if this comparator is not yet ready to start the comparison.com.irurueta.geometry.estimators.LockedException- if this instance is locked.FundamentalMatrixComparatorException- if comparison fails due to some other reason.
-
getType
Returns type of comparator.- Returns:
- type of comparator.
-