@@ -21,11 +21,35 @@ class CV_EXPORTS Twist
21
21
public:
22
22
Twist () = default ;
23
23
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
+ */
25
38
cv::Vec6d compute (const cv::Mat& uv, const cv::Mat& duv, const cv::Mat depths,
26
39
const cv::Mat& K);
27
40
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
+ */
29
53
void interactionMatrix (const cv::Mat& uv, const cv::Mat& depth, const cv::Mat& K, cv::Mat& J);
30
54
};
31
55
0 commit comments