31#include <visp3/rbt/vpRBSilhouetteMeTracker.h>
33#define VISP_DEBUG_ME_TRACKER 0
42 m_controlPoints.clear();
49#ifdef VISP_HAVE_OPENMP
53 std::vector<vpRBSilhouetteControlPoint> localPoints;
54#ifdef VISP_HAVE_OPENMP
64#if VISP_DEBUG_ME_TRACKER
77 if (m_useMask && frame.
hasMask()) {
78 double maxMaskGradient;
79 if (p.isSilhouette()) {
80 maxMaskGradient = p.getMaxMaskGradientAlongLine(frame.
mask, m_me.getRange());
83 maxMaskGradient = frame.
mask[sp.
i][sp.
j];
85 if (maxMaskGradient < m_minMaskConfidence) {
90 p.initControlPoint(initImage, 0);
91 p.setNumCandidates(m_numCandidates);
92 localPoints.push_back(std::move(p));
95#ifdef VISP_HAVE_OPENMP
99 m_controlPoints.insert(m_controlPoints.end(), localPoints.begin(), localPoints.end());
103 m_numFeatures =
static_cast<unsigned int>(m_controlPoints.size());
105 m_robust.setMinMedianAbsoluteDeviation(m_robustMadMin / frame.
cam.
get_px());
110 if (m_numCandidates <= 1) {
111#ifdef VISP_HAVE_OPENMP
112#pragma omp parallel for
114 for (
int i = 0; i < static_cast<int>(m_controlPoints.size()); ++i) {
115 m_controlPoints[i].track(frame.
I);
119#ifdef VISP_HAVE_OPENMP
120#pragma omp parallel for
122 for (
int i = 0; i < static_cast<int>(m_controlPoints.size()); ++i) {
123 m_controlPoints[i].trackMultipleHypotheses(frame.
I);
146 const double threshold = m_singlePointConvergedThresholdPixels / frame.
cam.
get_px();
149 unsigned countValidSites = 0;
151 for (
unsigned int k = 0; k < m_controlPoints.size(); k++) {
154 if (m_numCandidates <= 1) {
155 p.computeMeInteractionMatrixError(cMo, k,
m_L,
m_error);
158 p.computeMeInteractionMatrixErrorMH(cMo, k,
m_L,
m_error);
162 if (!p.siteIsValid() || !p.isValid()) {
164 for (
unsigned int j = 0; j < 6; j++) {
176 if (countValidSites == 0) {
180 const double percentageConverged =
static_cast<double>(count) /
static_cast<double>(countValidSites);
181 if (percentageConverged < m_globalVVSConvergenceThreshold) {
197#if VISP_DEBUG_ME_TRACKER
198 for (
unsigned int i = 0; i < 6; ++i) {
199 if (std::isnan(
m_LTR[i])) {
200 std::cerr <<
m_L << std::endl;
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
error that can be emitted by ViSP classes.
@ badValue
Used to indicate that a value is not in the allowed range.
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpRotationMatrix getRotationMatrix() const
Definition of the vpImage class member functions.
unsigned int getWidth() const
unsigned int getSize() const
unsigned int getHeight() const
Performs search in a given direction(normal) for a given distance(pixels) for a given 'site'....
void updateOptimizerTerms(const vpHomogeneousMatrix &cMo)
vpColVector m_weights
Weighted VS error.
vpColVector m_covWeightDiag
Covariance matrix.
vpColVector m_LTR
Left side of the Gauss newton minimization.
bool m_vvsConverged
User-defined weight for this specific type of feature.
unsigned m_numFeatures
Error weights.
vpColVector m_weighted_error
Raw VS Error vector.
Trackable silhouette point representation.
void initVVS(const vpRBFeatureTrackerInput &frame, const vpRBFeatureTrackerInput &previousFrame, const vpHomogeneousMatrix &cMo) VP_OVERRIDE
void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpImage< vpRGBa > &IRGB, const vpImage< unsigned char > &depth) const VP_OVERRIDE
void extractFeatures(const vpRBFeatureTrackerInput &frame, const vpRBFeatureTrackerInput &previousFrame, const vpHomogeneousMatrix &cMo) VP_OVERRIDE
Extract the geometric features from the list of collected silhouette points.
void trackFeatures(const vpRBFeatureTrackerInput &frame, const vpRBFeatureTrackerInput &previousFrame, const vpHomogeneousMatrix &cMo) VP_OVERRIDE
Track the features.
void computeVVSIter(const vpRBFeatureTrackerInput &frame, const vpHomogeneousMatrix &cMo, unsigned int iteration) VP_OVERRIDE
Silhouette point simple candidate representation.
double Z
angle of the normal in the image.
vpColVector normal
Pixel coordinates of the silhouette point.
double orientation
Normal to the silhouette at point i,j, in world frame.
bool isSilhouette
Point depth.
@ TUKEY
Tukey influence function.