Package boofcv.abst.geo.bundle
Class PruneStructureFromSceneMetric
java.lang.Object
boofcv.abst.geo.bundle.PruneStructureFromSceneMetric
makes it easy to removing elements from the scene's structure. Different criteria can be specified for each
type of element you wish to remove.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPruneStructureFromSceneMetric
(SceneStructureMetric structure, SceneObservations observations) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Check to see if a point is behind the camera which is viewing it.void
pruneObservationsByErrorRank
(double inlierFraction) Computes reprojection error for all features.void
pruneObservationsByReprojection
(double errorThreshold) Computes reprojection error for all features and removes the ones with reprojection errors larger than this valuevoid
prunePoints
(int count) Prunes Points/features with less than 'count' observations.void
prunePoints
(int neighbors, double distance) Prune a feature it has fewer than X neighbors within Y distance.boolean
Prunes cameras that are not referenced by any views.boolean
Prunes Motions that are not referenced by any views.boolean
pruneViews
(int count) Removes views with less than or equal to 'count' features visible.
-
Field Details
-
verbose
-
-
Constructor Details
-
PruneStructureFromSceneMetric
public PruneStructureFromSceneMetric(SceneStructureMetric structure, SceneObservations observations)
-
-
Method Details
-
pruneObservationsByErrorRank
public void pruneObservationsByErrorRank(double inlierFraction) Computes reprojection error for all features. Sorts the resulting residuals by magnitude. Prunes observations which have the largest errors first. After calling this function you should callprunePoints(int)
andpruneViews(int)
to ensure the scene is still valid.- Parameters:
inlierFraction
- Fraction of observations to keep. 0 to 1. 1 = no change. 0 = everything is pruned.
-
pruneObservationsByReprojection
public void pruneObservationsByReprojection(double errorThreshold) Computes reprojection error for all features and removes the ones with reprojection errors larger than this value- Parameters:
errorThreshold
- If the reprojection error is greater than this threshold prune them
-
pruneObservationsBehindCamera
public void pruneObservationsBehindCamera()Check to see if a point is behind the camera which is viewing it. If it is remove that observation since it can't possibly be observed. -
prunePoints
public void prunePoints(int count) Prunes Points/features with less than 'count' observations. Observations of the points are also removed. CallpruneViews(int)
to ensure that all views have points in view- Parameters:
count
- Minimum number of observations
-
prunePoints
public void prunePoints(int neighbors, double distance) Prune a feature it has fewer than X neighbors within Y distance. Observations associated with this feature are also pruned. CallpruneViews(int)
to makes sure the graph is valid.- Parameters:
neighbors
- Number of other features which need to be near bydistance
- Maximum distance a point can be to be considered a feature
-
pruneViews
public boolean pruneViews(int count) Removes views with less than or equal to 'count' features visible. Observations of features in removed views are also removed. Views which are parents (after children than can be removed have been removed) will remain since they are needed for the correct transform.- Parameters:
count
- Prune if less than or equal to this many features- Returns:
- true if the graph has been modified
-
pruneUnusedCameras
public boolean pruneUnusedCameras()Prunes cameras that are not referenced by any views.- Returns:
- true if the graph has been modified
-
pruneUnusedMotions
public boolean pruneUnusedMotions()Prunes Motions that are not referenced by any views.- Returns:
- true if the graph has been modified
-