![]() |
Visual Servoing Platform
version 3.6.1 under development (2025-02-17)
|
#include <visp3/rbt/vpRBProbabilistic3DDriftDetector.h>
Public Member Functions | |
vpRBProbabilistic3DDriftDetector () | |
void | update (const vpRBFeatureTrackerInput &previousFrame, const vpRBFeatureTrackerInput &frame, const vpHomogeneousMatrix &cTo, const vpHomogeneousMatrix &cprevTo) VP_OVERRIDE |
double | getScore () const VP_OVERRIDE |
bool | hasDiverged () const VP_OVERRIDE |
void | display (const vpImage< vpRGBa > &I) VP_OVERRIDE |
Settings | |
double | getMinDistForNew3DPoints () const |
void | setMinDistForNew3DPoints (double distance) |
double | getFilteringMax3DError () const |
void | setFilteringMax3DError (double maxError) |
double | getDepthStandardDeviation () const |
void | setDepthStandardDeviation (double sigma) |
double | getInitialColorStandardDeviation () const |
void | setInitialColorStandardDeviation (double sigma) |
double | getColorUpdateRate () const |
void | setColorUpdateRate (double updateRate) |
void | loadJsonConfiguration (const nlohmann::json &) VP_OVERRIDE |
Algorithm that uses tracks object surface points in order to estimate the probability that tracking is successful.
Given a set of surface points , each point
being associated to:
We compute the probability that tracking is successful for a given pose as:
with
if the depth is unavailable, then we set
Here, the color distribution is estimated online for each point separately using exponential moving average/variance techniques. For each point the update step is computed as where
is a fixed parameter. Larger values will lead to faster update rates and may be more beneficial for non lambertian materials.
For the depth, is a fixed parameter to be tweaked by the user.
Every time update() is called, the set of points may grow larger. If a new candidate point is visible and is far enough from points already in the set, it is added to it.
Definition at line 88 of file vpRBProbabilistic3DDriftDetector.h.
|
inline |
Definition at line 208 of file vpRBProbabilistic3DDriftDetector.h.
Displays the information used for drift detection.
I | the image in which to display the information |
Implements vpRBDriftDetector.
Definition at line 218 of file vpRBProbabilistic3DDriftDetector.cpp.
|
inline |
Get the rate at which the colors of surface points are updated.
Note that if depth is available, this component is further multiplied by the probability of depth being correct for a given point.
A high value will lead to a fast update rate (short term memory), while a lower one will update slower. A slower update may lead to a more stable tracking score. A higher value may be better suited to non isotropic materials.
Definition at line 300 of file vpRBProbabilistic3DDriftDetector.h.
|
inline |
Get the standard deviation that is used when computing the probability that the observed depth Z is the correct depth given the rendered depth at the same pixel.
Definition at line 269 of file vpRBProbabilistic3DDriftDetector.h.
|
inline |
Returns the maximum 3D distance (in meters) above which a tracked surface point is rejected for the drift estimation step.
The surface point's distance to the camera is compared to rendered depth. If the difference between the two is too great, it is rejected.
This is mainly used to handle self occlusions.
Definition at line 254 of file vpRBProbabilistic3DDriftDetector.h.
|
inline |
Get the standard deviation that is used to initialize the color distribution when adding a new surface point. This standard deviation is applied on all color components.
Definition at line 283 of file vpRBProbabilistic3DDriftDetector.h.
|
inline |
Get the minimum distance criterion (in meters) that is used when trying to add new points to track for the drift detection.
A candidate surface point is compared to all the currently tracked surface point and if any of these points is below the minimum distance, the candidate is rejected.
Definition at line 237 of file vpRBProbabilistic3DDriftDetector.h.
|
virtual |
Returns the probability [0, 1] that tracking is successful.
Implements vpRBDriftDetector.
Definition at line 232 of file vpRBProbabilistic3DDriftDetector.cpp.
|
virtual |
Returns whether the tracking has diverged and should be reinitialized. This function should be called after update.
Implements vpRBDriftDetector.
Definition at line 237 of file vpRBProbabilistic3DDriftDetector.cpp.
|
virtual |
Implements vpRBDriftDetector.
Definition at line 243 of file vpRBProbabilistic3DDriftDetector.cpp.
References setColorUpdateRate(), setDepthStandardDeviation(), setFilteringMax3DError(), setInitialColorStandardDeviation(), and setMinDistForNew3DPoints().
|
inline |
Set the update rate for the color distribution. It should be between 0 and 1.
updateRate | the update rate |
Definition at line 307 of file vpRBProbabilistic3DDriftDetector.h.
References vpException::badValue.
Referenced by loadJsonConfiguration().
|
inline |
Definition at line 270 of file vpRBProbabilistic3DDriftDetector.h.
References vpException::badValue.
Referenced by loadJsonConfiguration().
|
inline |
Definition at line 256 of file vpRBProbabilistic3DDriftDetector.h.
References vpException::badValue.
Referenced by loadJsonConfiguration().
|
inline |
Definition at line 284 of file vpRBProbabilistic3DDriftDetector.h.
References vpException::badValue.
Referenced by loadJsonConfiguration().
|
inline |
Definition at line 239 of file vpRBProbabilistic3DDriftDetector.h.
References vpException::badValue.
Referenced by loadJsonConfiguration().
|
virtual |
Update the algorithm after a new tracking step.
previousFrame | The previous frame data: contains the input images at t-1 (linked to cprevTo) and the renders at t-2. May be empty for the first iteration |
frame | The current frame data: contains the input images at time t (linked to the newly estimated cTo) and the renders at t-1 (linked to cprevTo) |
cTo | the newly estimated object pose in the camera frame |
cprevTo | the previously estimated object pose in the camera frame |
Implements vpRBDriftDetector.
Definition at line 45 of file vpRBProbabilistic3DDriftDetector.cpp.
References vpRGBa::B, vpRGBf::B, vpException::badValue, vpRBRenderData::boundingBox, vpRBFeatureTrackerInput::cam, vpRBRenderData::cMo, vpPixelMeterConversion::convertPoint(), vpRBRenderData::depth, vpRBFeatureTrackerInput::depth, vpColVector::dotProd(), vpRGBa::G, vpRGBf::G, vpRect::getBottom(), vpImage< Type >::getHeight(), vpRect::getLeft(), vpRect::getRight(), vpRect::getTop(), vpHomogeneousMatrix::getTranslationVector(), vpImage< Type >::getWidth(), vpRBFeatureTrackerInput::hasDepth(), vpRBSilhouettePoint::i, vpHomogeneousMatrix::inverse(), vpRBFeatureTrackerInput::IRGB, vpRBSilhouettePoint::j, vpColVector::normalize(), vpRBRenderData::normals, vpRGBa::R, vpRGBf::R, vpMath::rad(), vpRBFeatureTrackerInput::renders, vpRBFeatureTrackerInput::silhouettePoints, and vpMath::sqr().