Visual Servoing Platform
version 3.6.1 under development (2024-11-14)
|
#include <visp3/dnn_tracker/vpMegaPoseTracker.h>
Public Member Functions | |
vpMegaPoseTracker (std::shared_ptr< vpMegaPose > megapose, const std::string &objectLabel, const int refinerIterations) | |
std::future< vpMegaPoseEstimate > | init (const vpImage< vpRGBa > &I, const vpRect &bb) |
std::future< vpMegaPoseEstimate > | init (const vpImage< vpRGBa > &I, const vpHomogeneousMatrix &cTo) |
std::future< vpMegaPoseEstimate > | track (const vpImage< vpRGBa > &I) |
void | updatePose (const vpHomogeneousMatrix &cTo) |
A simplified interface to track a single object with MegaPose. This tracker works asynchronously: A call to init or track will not stop the current thread. Rather, an std::future object is returned, and its result should be acquired when it is ready.
To instantiate and use the tracker:
For a more detailed usage see Tutorial: Tracking with MegaPose.
Definition at line 103 of file vpMegaPoseTracker.h.
|
inline |
Construct a new MegaPose tracker.
[in] | megapose | : A valid connection to the MegaPose server. |
[in] | objectLabel | : The name of the object to track. |
[in] | refinerIterations | : Number of refiner iterations to perform every time init or track is called. Impacts performance. |
Definition at line 113 of file vpMegaPoseTracker.h.
std::future< vpMegaPoseEstimate > vpMegaPoseTracker::init | ( | const vpImage< vpRGBa > & | I, |
const vpHomogeneousMatrix & | cTo | ||
) |
Initialize tracking from an initial pose. The initial pose should be in the neighborhood of the true pose. The pose should be expressed in the camera frame. This method will call MegaPose to correct the initial estimate and initialize the tracking.
[in] | I | : The image in which the object is located. |
[in] | cTo | : An initial, coarse, estimate of the object pose. |
Definition at line 53 of file vpMegaPoseTracker.cpp.
BEGIN_VISP_NAMESPACE std::future< vpMegaPoseEstimate > vpMegaPoseTracker::init | ( | const vpImage< vpRGBa > & | I, |
const vpRect & | bb | ||
) |
Initialize tracking. Performs a full object pose estimation with megapose.
This is slower than tracking.
Requires a bounding box of the object to track.
[in] | I | : The image in which the object is located. |
[in] | bb | : The bounding box of the object. |
Definition at line 44 of file vpMegaPoseTracker.cpp.
std::future< vpMegaPoseEstimate > vpMegaPoseTracker::track | ( | const vpImage< vpRGBa > & | I | ) |
Track the object in the image. Requires the tracker to be initialized by calling init.
[in] | I | : The image containing the object to track. |
Definition at line 63 of file vpMegaPoseTracker.cpp.
References vpMegaPoseEstimate::cTo, and vpException::notInitialized.
void vpMegaPoseTracker::updatePose | ( | const vpHomogeneousMatrix & | cTo | ) |
Update the current pose estimate with a new one, provided by an external source. No operation (such as init or track) should be running.
[in] | cTo | : The new pose estimate. |
Definition at line 75 of file vpMegaPoseTracker.cpp.
References vpMegaPoseEstimate::cTo.