31 #include <visp3/rbt/vpRBSilhouetteMeTracker.h>
33 #define VISP_DEBUG_ME_TRACKER 0
42 m_controlPoints.clear();
53 #if VISP_DEBUG_ME_TRACKER
62 if (m_useMask && frame.
hasMask()) {
63 float confidence = frame.
mask[sp.
i][sp.
j];
64 if (confidence < m_minMaskConfidence) {
79 m_controlPoints.push_back(p);
88 if (m_numCandidates <= 1) {
95 p.trackMultipleHypotheses(frame.
I);
118 const double threshold = m_singlePointConvergedThresholdPixels / frame.
cam.
get_px();
121 unsigned countValidSites = 0;
123 for (
unsigned int k = 0; k < m_controlPoints.size(); k++) {
126 if (m_numCandidates <= 1) {
136 for (
unsigned int j = 0; j < 6; j++) {
148 if (countValidSites == 0) {
152 const double percentageConverged = (double)count / (
double)countValidSites;
153 if (percentageConverged < m_globalVVSConvergenceThreshold) {
163 for (
unsigned int i = 0; i <
m_error.
size(); i++) {
164 const double wi =
m_weights[i] * factor[i];
168 for (
unsigned int j = 0; j < 6; j++) {
169 m_L[i][j] = wi *
m_L[i][j];
176 #if VISP_DEBUG_ME_TRACKER
177 for (
unsigned int i = 0; i < 6; ++i) {
178 if (std::isnan(
m_LTR[i])) {
179 std::cerr <<
m_L << std::endl;
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
unsigned int size() const
Return the number of elements of the 2D array.
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
void resize(unsigned int i, bool flagNullify=true)
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
vpHomogeneousMatrix inverse() const
unsigned int getSize() const
Performs search in a given direction(normal) for a given distance(pixels) for a given 'site'....
void display(const vpImage< unsigned char > &I) const
vpColVector m_weights
Weighted VS error.
vpMatrix m_LTL
Error jacobian (In VS terms, the interaction matrix)
vpColVector m_covWeightDiag
Covariance matrix.
vpColVector m_LTR
Left side of the Gauss newton minimization.
static void computeJTR(const vpMatrix &interaction, const vpColVector &error, vpColVector &JTR)
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 setNumCandidates(unsigned numCandidates)
Set the number of candidates to use for multiple hypotheses testing.
void buildPoint(int n, int m, const double &Z, double orient, const vpColVector &normo, const vpHomogeneousMatrix &cMo, const vpHomogeneousMatrix &oMc, const vpCameraParameters &cam, const vpMe &me)
void computeMeInteractionMatrixError(const vpHomogeneousMatrix &cMo, unsigned int i, vpMatrix &L, vpColVector &e)
void initControlPoint(const vpImage< unsigned char > &I, double cvlt)
void computeMeInteractionMatrixErrorMH(const vpHomogeneousMatrix &cMo, unsigned int i, vpMatrix &L, vpColVector &e)
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.
@ TUKEY
Tukey influence function.
void MEstimator(const vpRobustEstimatorType method, const vpColVector &residues, vpColVector &weights)
void setMinMedianAbsoluteDeviation(double mad_min)