![]() |
Visual Servoing Platform version 3.7.0
|
#include <vpRBProbabilistic3DDriftDetector.h>
Classes | |
| struct | vpStored3DSurfaceColorPoint |
Public Member Functions | |
| vpRBProbabilistic3DDriftDetector () | |
| void | update (const vpRBFeatureTrackerInput &previousFrame, const vpRBFeatureTrackerInput &frame, const vpHomogeneousMatrix &cTo, const vpHomogeneousMatrix &cprevTo) VP_OVERRIDE |
| double | score (const vpRBFeatureTrackerInput &frame, const vpHomogeneousMatrix &cTo) VP_OVERRIDE |
| double | getScore () const VP_OVERRIDE |
| bool | hasDiverged () const VP_OVERRIDE |
| void | reset () 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) |
| unsigned int | getSampleStep () const |
| void | setSampleStep (unsigned int sampleStep) |
| void | loadJsonConfiguration (const nlohmann::json &) VP_OVERRIDE |
| void | loadRepresentation (const std::string &) |
| void | saveRepresentation (const std::string &) const |
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.
Tutorials
If you want to have an in-depth presentation of the Render-Based Tracker (RBT), you may have a look at:
Definition at line 99 of file vpRBProbabilistic3DDriftDetector.h.
|
inline |
Definition at line 243 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 295 of file vpRBProbabilistic3DDriftDetector.cpp.
References vpDisplay::displayPoint().
|
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 349 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 316 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 301 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 330 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 282 of file vpRBProbabilistic3DDriftDetector.h.
|
inline |
Definition at line 364 of file vpRBProbabilistic3DDriftDetector.h.
|
virtual |
Returns the probability [0, 1] that tracking is successful.
Implements vpRBDriftDetector.
Definition at line 306 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 311 of file vpRBProbabilistic3DDriftDetector.cpp.
|
virtual |
Implements vpRBDriftDetector.
Definition at line 317 of file vpRBProbabilistic3DDriftDetector.cpp.
References setColorUpdateRate(), setDepthStandardDeviation(), setFilteringMax3DError(), setInitialColorStandardDeviation(), setMinDistForNew3DPoints(), and setSampleStep().
| void vpRBProbabilistic3DDriftDetector::loadRepresentation | ( | const std::string & | filename | ) |
Definition at line 327 of file vpRBProbabilistic3DDriftDetector.cpp.
References vpException::ioError.
|
inlinevirtual |
Reimplemented from vpRBDriftDetector.
Definition at line 261 of file vpRBProbabilistic3DDriftDetector.h.
References reset().
Referenced by reset().
| void vpRBProbabilistic3DDriftDetector::saveRepresentation | ( | const std::string & | filename | ) | const |
Definition at line 338 of file vpRBProbabilistic3DDriftDetector.cpp.
References vpException::ioError.
|
virtual |
Implements vpRBDriftDetector.
Definition at line 46 of file vpRBProbabilistic3DDriftDetector.cpp.
References vpRGBa::B, vpRGBf::B, vpRBFeatureTrackerInput::cam, vpRBRenderData::cMo, vpRBFeatureTrackerInput::depth, vpRBRenderData::depth, vpRGBa::G, vpRGBf::G, vpImage< Type >::getHeight(), vpMath::getMean(), vpMath::getMedian(), vpHomogeneousMatrix::getTranslationVector(), vpImage< Type >::getWidth(), vpRBFeatureTrackerInput::hasDepth(), vpRBSilhouettePoint::i, vpRBFeatureTrackerInput::IRGB, vpRBSilhouettePoint::j, vpRGBa::R, vpRGBf::R, vpRBFeatureTrackerInput::renders, score(), vpRBFeatureTrackerInput::silhouettePoints, and vpMath::sqr().
|
inline |
Set the update rate for the color distribution. It should be between 0 and 1.
| updateRate | the update rate |
Definition at line 356 of file vpRBProbabilistic3DDriftDetector.h.
References vpException::badValue.
Referenced by loadJsonConfiguration().
|
inline |
Definition at line 317 of file vpRBProbabilistic3DDriftDetector.h.
References vpException::badValue.
Referenced by loadJsonConfiguration().
|
inline |
Definition at line 303 of file vpRBProbabilistic3DDriftDetector.h.
References vpException::badValue.
Referenced by loadJsonConfiguration().
|
inline |
Definition at line 331 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 365 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 230 of file vpRBProbabilistic3DDriftDetector.cpp.
References vpRGBa::B, vpRBRenderData::boundingBox, vpRBFeatureTrackerInput::cam, vpRBRenderData::cMo, vpMeterPixelConversion::convertPoint(), vpPixelMeterConversion::convertPoint(), vpRBRenderData::depth, vpRGBa::G, vpRect::getBottom(), vpImage< Type >::getHeight(), vpRect::getLeft(), vpRect::getRight(), vpRect::getTop(), vpImage< Type >::getWidth(), vpRBProbabilistic3DDriftDetector::vpStored3DSurfaceColorPoint::ColorStatistics::init(), vpHomogeneousMatrix::inverse(), vpRBFeatureTrackerInput::IRGB, vpRGBa::R, vpRBFeatureTrackerInput::renders, score(), vpMath::sqr(), vpRBProbabilistic3DDriftDetector::vpStored3DSurfaceColorPoint::stats, and vpRBProbabilistic3DDriftDetector::vpStored3DSurfaceColorPoint::X.