Skip to content

Commit cc62da9

Browse files
docs
1 parent c227028 commit cc62da9

File tree

1 file changed

+26
-2
lines changed
  • modules/tracking/include/opencv2/tracking

1 file changed

+26
-2
lines changed

modules/tracking/include/opencv2/tracking/twist.hpp

+26-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,35 @@ class CV_EXPORTS Twist
2121
public:
2222
Twist() = default;
2323

24-
// TODO(ernie): docs
24+
/**
25+
* @brief Compute the camera twist from a set of 2D pixel locations, their
26+
* velocities, depth values and intrinsic parameters of the camera. The pixel
27+
* velocities are usually obtained from optical flow algorithms, both dense and
28+
* sparse flow can be used to compute the flow between images and duv computed by
29+
* dividing the flow by the time interval between the images.
30+
*
31+
* @param uv 2xN matrix of 2D pixel locations
32+
* @param duv 2Nx1 matrix of 2D pixel velocities
33+
* @param depths 1xN matrix of depth values
34+
* @param K 3x3 camera intrinsic matrix
35+
*
36+
* @return cv::Vec6d 6x1 camera twist
37+
*/
2538
cv::Vec6d compute(const cv::Mat& uv, const cv::Mat& duv, const cv::Mat depths,
2639
const cv::Mat& K);
2740

28-
// TODO(ernie): docs
41+
/**
42+
* @brief Compute the interaction matrix for a set of 2D pixels. This is usually
43+
* used in visual servoing applications to command a robot to move at desired pixel
44+
* locations/velocities. By inverting this matrix one can estimate camera spatial
45+
* velocity i.e., the twist.
46+
*
47+
* @param uv 2xN matrix of 2D pixel locations
48+
* @param depth 1xN matrix of depth values
49+
* @param K 3x3 camera intrinsic matrix
50+
* @param J 2Nx6 interaction matrix
51+
*
52+
*/
2953
void interactionMatrix(const cv::Mat& uv, const cv::Mat& depth, const cv::Mat& K, cv::Mat& J);
3054
};
3155

0 commit comments

Comments
 (0)