result coordinate type

asked 2020-08-25 13:16:56 -0600

superfly gravatar image

I have been making intersection point calculations between parametric line eqs and planes in opencv. I am using raw imaging point data for the math calculations below. What units of measurement are my results? I haven't done a opencv Rodriquez, transformation or other function on this data set yet, otherwise the question would be settled.

I've also tried "converting" to U, V coordinates but am unsure if its correct.

double numer = plane.get_numer(d, n, Ro); // origin point - p - see diagram 
double denom = plane.get_denom(n, Rd);
double t = numer / denom;
Vec3d IP = plane.get_IP(Ro, Rd, t); // IP = 'intersection point'
double U = CV_FX * IP[0] + CV_CX;
double V = CV_FY * IP[1] + CV_CY;
std::cout << "U,V = " << U << "," << V << std::endl;
edit retag flag offensive close merge delete

Comments

we cannot see, what your plane class does, and there's no explanation for CV_FX etc. but if the input was in pixels, the output will be, too.

berak gravatar imageberak ( 2020-08-26 01:52:37 -0600 )edit

CV_FX, CV_FY, CV_CX, CV_CY belong to K (camera intrinsics).

class Plane {
    public:
        Vec3d cal_vector(Point3d point1, Point3d point2) { return point2 - point1; }
        Vec3d normal(Vec3d Q, Vec3d R) { return Q.cross(R); }
        double cal_D(Vec3d n, Point3d raw_scene_p2) { return -(n.dot(raw_scene_p2));} // d calculated with plane points
        double get_numer(double d, Vec3d n, Vec3d Ro) { return -1 * (d + n.dot(Ro)); }
        double get_denom(Vec3d n, Vec3d Rd) {return n.dot(Rd); }
        Vec3d get_IP(Vec3d Ro, Vec3d Rd, double t) { return Ro + t * Rd; }
        // n.p + d = 0

};enter code here

superfly gravatar imagesuperfly ( 2020-08-26 09:38:54 -0600 )edit