Using tf to transform opencv vector [closed]
Hi,
I have an opencv vector cv::Vec3f and I need to transform it to other frame using tf. I came up with this solution which I don't like much, because I'll be transforming many vectors.
cv::Vec3f transformCvVector(const tf::StampedTransform & transform, const cv::Vec3f & v) {
tf::Vector3 tfV(v[0], v[1], v[2]);
tf::Vector3 tfRes = transform*tfV;
return cv::Vec3f(tfRes[0], tfRes[1],tfRes[2]);
Did I miss something or is it the only way? I might be able to use bullet library instead of opencv for this, but I wasn't able to find a way how to represent other matrices than 3x3 or 4x4 which is necessary for my task.