Package com.irurueta.ar.sfm
Interface BaseSparseReconstructorListener<R extends BaseSparseReconstructor<?,?,?>>
- Type Parameters:
R
- type of re-constructor.
- All Known Subinterfaces:
AbsoluteOrientationConstantVelocityModelSlamSparseReconstructorListener
,AbsoluteOrientationSlamSparseReconstructorListener
,BaseSlamSparseReconstructorListener<R>
,ConstantVelocityModelSlamSparseReconstructorListener
,KnownBaselineSparseReconstructorListener
,SlamSparseReconstructorListener
,SparseReconstructorListener
public interface BaseSparseReconstructorListener<R extends BaseSparseReconstructor<?,?,?>>
Listener to retrieve and store required data to compute a 3D reconstruction from
sparse image point correspondences in multiple views.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
hasMoreViewsAvailable
(R reconstructor) Called to determine whether there are more views available to attempt to use for the reconstruction.void
Called when reconstruction is cancelled before it has finished.void
onEuclideanCameraEstimated
(R reconstructor, int previousViewId, int currentViewId, double scale, EstimatedCamera previousCamera, EstimatedCamera currentCamera) Called when cameras for provided matched pair of views have been estimated in an Euclidean stratum (when possible and up to a certain accuracy).void
onEuclideanReconstructedPointsEstimated
(R reconstructor, double scale, List<ReconstructedPoint3D> points) Called when reconstructed points have been estimated from a series of 2D matches.void
Called when reconstruction fails.void
Called when reconstruction stops.void
onFundamentalMatrixEstimated
(R reconstructor, EstimatedFundamentalMatrix estimatedFundamentalMatrix) Called when a fundamental matrix relating two views has been estimated.void
onMetricCameraEstimated
(R reconstructor, int previousViewId, int currentViewId, EstimatedCamera previousCamera, EstimatedCamera currentCamera) Notifies when cameras for provided matched pair of views have been estimated.void
onMetricReconstructedPointsEstimated
(R reconstructor, List<MatchedSamples> matches, List<ReconstructedPoint3D> points) Called when reconstructed points have been estimated from a series of 2D matches.void
onRequestMatches
(R reconstructor, List<Sample2D> allPreviousViewSamples, List<Sample2D> previousViewTrackedSamples, List<Sample2D> currentViewTrackedSamples, int previousViewId, int currentViewId, List<MatchedSamples> matches) Finds matches for provided samples.void
onRequestSamples
(R reconstructor, int previousViewId, int currentViewId, List<Sample2D> previousViewTrackedSamples, List<Sample2D> currentViewTrackedSamples, List<Sample2D> currentViewNewlySpawnedSamples) Called when samples containing points of interest for current view must be retrieved.void
onSamplesAccepted
(R reconstructor, int viewId, List<Sample2D> previousViewTrackedSamples, List<Sample2D> currentViewTrackedSamples) Called when requested samples have been accepted.void
onSamplesRejected
(R reconstructor, int viewId, List<Sample2D> previousViewTrackedSamples, List<Sample2D> currentViewTrackedSamples) Called when requested samples have been rejected.void
Called when reconstruction starts.
-
Method Details
-
hasMoreViewsAvailable
Called to determine whether there are more views available to attempt to use for the reconstruction.- Parameters:
reconstructor
- re-constructor raising this event.- Returns:
- true if there are more views available, false otherwise.
-
onRequestSamples
void onRequestSamples(R reconstructor, int previousViewId, int currentViewId, List<Sample2D> previousViewTrackedSamples, List<Sample2D> currentViewTrackedSamples, List<Sample2D> currentViewNewlySpawnedSamples) Called when samples containing points of interest for current view must be retrieved.- Parameters:
reconstructor
- re-constructor raising this event.previousViewId
- id of previous view.currentViewId
- id of current view.previousViewTrackedSamples
- tracked samples from previous view.currentViewTrackedSamples
- tracked samples from previous view containing points of interest on current view.currentViewNewlySpawnedSamples
- new created samples containing points of interest on current view.
-
onSamplesAccepted
void onSamplesAccepted(R reconstructor, int viewId, List<Sample2D> previousViewTrackedSamples, List<Sample2D> currentViewTrackedSamples) Called when requested samples have been accepted. This method can be used to determine whether samples can be stored or not.- Parameters:
reconstructor
- re-constructor raising this event.viewId
- id of view whose samples have been accepted.previousViewTrackedSamples
- accepted tracked samples on previous view. Might be null on first view.currentViewTrackedSamples
- accepted tracked samples on current view.
-
onSamplesRejected
void onSamplesRejected(R reconstructor, int viewId, List<Sample2D> previousViewTrackedSamples, List<Sample2D> currentViewTrackedSamples) Called when requested samples have been rejected. This method can be used to remove provided samples.- Parameters:
reconstructor
- re-constructor raising this event.viewId
- id of view whose samples have been rejected.previousViewTrackedSamples
- rejected samples on previous view. Might be null on first view.currentViewTrackedSamples
- rejected samples on current view.
-
onRequestMatches
void onRequestMatches(R reconstructor, List<Sample2D> allPreviousViewSamples, List<Sample2D> previousViewTrackedSamples, List<Sample2D> currentViewTrackedSamples, int previousViewId, int currentViewId, List<MatchedSamples> matches) Finds matches for provided samples. Typically, implementations will need to search for closest points of tracked points in previous view within the whole list of samples in previous view. The implementation might choose to search for other matches or even include samples from previous views to increase the accuracy of reconstructed points.- Parameters:
reconstructor
- re-constructor raising this event.allPreviousViewSamples
- all samples on previous views.previousViewTrackedSamples
- tracked samples on previous view.currentViewTrackedSamples
- tracked samples on current view.previousViewId
- id of previous view.currentViewId
- id of current view.matches
- instance where matches must be stored.
-
onFundamentalMatrixEstimated
void onFundamentalMatrixEstimated(R reconstructor, EstimatedFundamentalMatrix estimatedFundamentalMatrix) Called when a fundamental matrix relating two views has been estimated. This event can be used to store estimated fundamental matrix relating two views.- Parameters:
reconstructor
- re-constructor raising this event.estimatedFundamentalMatrix
- estimated fundamental matrix.
-
onMetricCameraEstimated
void onMetricCameraEstimated(R reconstructor, int previousViewId, int currentViewId, EstimatedCamera previousCamera, EstimatedCamera currentCamera) Notifies when cameras for provided matched pair of views have been estimated. Cameras returned on this event are defined in a metric stratum (i.e. up to scale). This event can be used to store cameras associated to such view.- Parameters:
reconstructor
- re-constructor raising this event.previousViewId
- id of previous view (i.e. first view).currentViewId
- id of current view (i.e. second view).previousCamera
- estimated camera for previous view.currentCamera
- estimated camera for current view.
-
onMetricReconstructedPointsEstimated
void onMetricReconstructedPointsEstimated(R reconstructor, List<MatchedSamples> matches, List<ReconstructedPoint3D> points) Called when reconstructed points have been estimated from a series of 2D matches. Reconstructed points returned on this event are defined in a metric stratum (i.e. up to scale). This event can be used to store reconstructed points and their associated data.- Parameters:
reconstructor
- re-constructor raising this event.matches
- 2D matches associated to estimated reconstructed points.points
- reconstructed 3D points.
-
onEuclideanCameraEstimated
void onEuclideanCameraEstimated(R reconstructor, int previousViewId, int currentViewId, double scale, EstimatedCamera previousCamera, EstimatedCamera currentCamera) Called when cameras for provided matched pair of views have been estimated in an Euclidean stratum (when possible and up to a certain accuracy). ExceptSparseReconstructor
, which can only make estimations in a metric stratum, other reconstructor implementations either have calibration knowledge to estimate scale, or use SLAM techniques by mixing additional sensor data (i.e. gyroscope and accelerometer) to estimate such scale.- Parameters:
reconstructor
- re-constructor raising this event.previousViewId
- id of previous view (i.e. first view).currentViewId
- id of current view (i.e. second view).scale
- estimated scale. This will typically converge to a constant value as more views are processed. The smaller the variance of estimated scale, the more accurate the scale will be.previousCamera
- estimated camera for previous view.currentCamera
- estimated camera for current view.
-
onEuclideanReconstructedPointsEstimated
void onEuclideanReconstructedPointsEstimated(R reconstructor, double scale, List<ReconstructedPoint3D> points) Called when reconstructed points have been estimated from a series of 2D matches. ExceptSparseReconstructor
, which can only make estimations in a metric stratum, other re-constructor implementations either have calibration knowledge to estimate scale, or use SLAM techniques by mixing additional sensor data (i.e. gyroscope and accelerometer) to estimate such scale.- Parameters:
reconstructor
- re-constructor raising this event.scale
- estimated scale. This will typically converge to a constant value as more views are processed. The smaller the variance of estimated scale, the more accurate the scale will be.points
- reconstructed 3D points.
-
onStart
Called when reconstruction starts.- Parameters:
reconstructor
- re-constructor raising this event.
-
onFinish
Called when reconstruction stops.- Parameters:
reconstructor
- re-constructor raising this event.
-
onCancel
Called when reconstruction is cancelled before it has finished.- Parameters:
reconstructor
- re-constructor raising this event.
-
onFail
Called when reconstruction fails.- Parameters:
reconstructor
- re-constructor raising this event.
-