Using tf to transform opencv vector [closed]

asked 2012-11-11 07:55:53 -0600

Scea gravatar image


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.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2015-09-18 18:47:09.903247