Skip to content

Conversation

SamFlt
Copy link
Contributor

@SamFlt SamFlt commented Sep 24, 2025

This PR introduces new functionalities to the Render-Based Tracker:

General:

  • The render data now contains more information, such as the object's diameter (bounding box extent) and 3D corners in object space.
  • The tracker can now be reset and the model reloaded more easily, without bugs related to Panda3D appearing. The reset function should be called when changing object or reinitalizing tracking. Some of the tracker's parts are stateful so this is important.
  • Rendering is now done at a lower precision. High FP32 precision is not really needed, and GPU to CPU transfer is extremely slow. For the Geometry renderer, The amount of transmitted bytes has been divided by 4. These changes had no significant impact when evaluating on several benchmarking datasets. In my tests, they improved render speed by around ~30%. For instance, a render that took 7ms now takes 5, which is not negligible when considering that rendering can happen twice per frame (when odometry is activated).
  • Reworked the convergence metric (early stopping for the optimizer and rerendering criterion). Added the reprojection error as a criterion, which is easier to reason with.
  • Fixed a bug where the object contours that were too close to the computed object's 2D bounding box were not detected.
  • Update documentation with new features and odometry.

Masking:

  • a Rework of the color masking process to use logistic regression instead of the previous solution that was based on the object/background probability ratio along with an hyperparameter threshold to be tweaked by the user. The masks are now generally far less noisy. An another solution instead of logistic regression would be to use the Bayes'rule, but this solution fails when we consider a small object that has a color similar to that of the background.
  • Some computational speedup in color masking.
  • Introduced a new Depth mask strategy
  • Introduced a Combined color/depth masking strategy. The strategy is to take the minimum of the probabilities estimated by the color or depth mask.

Features:

  • Introduced an experimental trackable feature, based on photometric Visual servoing.
  • In Python, added XFeat keypoints as trackable features.
  • Some of the M-estimators now use adaptive values that depend on the object's size in the image or in 3D space
  • Improved speed for the depth based tracker

Odometry:

  • Integrated the XFeat Visual Odometry strategy.

Pose estimation:

  • Developed two pose estimation approaches based on leveraging XFeat to solve the PnP problem.
  • Usage tutorial and script to use those methods

Others:

  • Integrate Python JSON parsing for XFeat tracker and odometry

Known issues:

  • As there is now a more significant part of the code that is pure Python, it has become apparent that there is an issue with the stubs and documentation generation: The Python part is not parsed and Sphinx (used for the doc) does not correctly generate the pages for each class. This will be the subject of a later PR.

SamFlt added 30 commits July 10, 2025 14:09
…ow management so that other windows are correctly disabled
Copy link
Contributor

@fspindle fspindle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general,

  • Check if copyright headers are present
  • Protect openmp usage with `#if defined(VISP_HAVE_OPENMP) in *.cpp files. Avoid openmp usage in *.h
  • Remove useless empty lines


virtual FrameBufferProperties getBufferProperties() const = 0;
virtual PointerTo<Texture> setupTexture(const FrameBufferProperties &fbp) const;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this useless empty line. One is enough

PointerTo<GraphicsOutput> getMainOutputBuffer() VP_OVERRIDE { return m_normalDepthBuffer; }

bool isFastAndApproximateRendering() const { return m_fast; }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this useless empty line. One is enough

virtual void initFromParent(PointerTo<WindowFramework> window);
virtual void initFromParent(const vpPanda3DBaseRenderer &renderer);


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this useless empty line. One is enough

void initFromParent(PointerTo<WindowFramework> window) VP_OVERRIDE;
void initFromParent(const vpPanda3DBaseRenderer &renderer) VP_OVERRIDE;


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this useless empty line. One is enough

);
}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this useless empty line. One is enough

const vpImage<float> &depth = previousFrame.depth.getSize() == 0 ? frame.depth : previousFrame.depth;
if (depth.getSize() > 0 && m_depthErrorTolerance > 0.f) {
#pragma omp parallel for
for (unsigned int i = top; i <= static_cast<unsigned int>(bottom); ++i) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm right, when using omp, when using unsigned int compiler produces a warning. For me vars should be int. To be confirmed

@@ -0,0 +1,64 @@
/*
* ViSP, open source Visual Servoing Platform software.
* Copyright (C) 2005 - 2024 by Inria. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2004 - 2025

@@ -0,0 +1,95 @@
/*
* ViSP, open source Visual Servoing Platform software.
* Copyright (C) 2005 - 2024 by Inria. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2005- 2025

m_depthMask.updateMask(frame, previousFrame, m_depth);
mask.resize(m_color.getHeight(), m_color.getWidth());

#pragma omp parallel for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add protection

#if defined(VISP_HAVE_OPENMP)

Should be checked everywhere


const std::string vpPanda3DDepthCannyFilter::FRAGMENT_SHADER =
"#version 330\n"
"#define PI 3.1415926538\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no other way to define PI in shaders, for example using M_PI?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants