OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Wed, 26 Aug 2020 09:38:54 -0500result coordinate typehttp://answers.opencv.org/question/234253/result-coordinate-type/ 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;Tue, 25 Aug 2020 13:16:56 -0500http://answers.opencv.org/question/234253/result-coordinate-type/Comment by superfly for <p>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. </p>
<p>I've also tried "converting" to U, V coordinates but am unsure if its correct.</p>
<pre><code>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;
</code></pre>
http://answers.opencv.org/question/234253/result-coordinate-type/?comment=234312#post-id-234312CV_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 hereWed, 26 Aug 2020 09:38:54 -0500http://answers.opencv.org/question/234253/result-coordinate-type/?comment=234312#post-id-234312Comment by berak for <p>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. </p>
<p>I've also tried "converting" to U, V coordinates but am unsure if its correct.</p>
<pre><code>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;
</code></pre>
http://answers.opencv.org/question/234253/result-coordinate-type/?comment=234287#post-id-234287we 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.Wed, 26 Aug 2020 01:52:37 -0500http://answers.opencv.org/question/234253/result-coordinate-type/?comment=234287#post-id-234287