OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Tue, 07 May 2013 07:50:13 -0500What is the meaning of cv::Point::cross()?http://answers.opencv.org/question/12987/what-is-the-meaning-of-cvpointcross/I noticed in the headers that `cv::Point` has a `.cross()` method returning a `double`.
Had it returned a `cv::Point3d`, it would have made sense as the cross-product of two 2D homogeneous points with the last coefficient implicitly being set to `1` (in this case, if the 2 points were 2D points in the image plane then the results is the 2D *line* passing through them).
In fact, the result of `cv::Point::cross()` is actually the 3rd element of the 3D cross-product above.
What is the intent and/or geometric meaning of the existing method?
More specifically, is there a projective interpretation for this value, given that 2D points *are* represented by 3-element vectors in projective space?Tue, 07 May 2013 03:07:58 -0500http://answers.opencv.org/question/12987/what-is-the-meaning-of-cvpointcross/Answer by Mathieu Barnachon for <p>I noticed in the headers that <code>cv::Point</code> has a <code>.cross()</code> method returning a <code>double</code>. </p>
<p>Had it returned a <code>cv::Point3d</code>, it would have made sense as the cross-product of two 2D homogeneous points with the last coefficient implicitly being set to <code>1</code> (in this case, if the 2 points were 2D points in the image plane then the results is the 2D <em>line</em> passing through them). <br>
In fact, the result of <code>cv::Point::cross()</code> is actually the 3rd element of the 3D cross-product above. </p>
<p>What is the intent and/or geometric meaning of the existing method? <br>
More specifically, is there a projective interpretation for this value, given that 2D points <em>are</em> represented by 3-element vectors in projective space?</p>
http://answers.opencv.org/question/12987/what-is-the-meaning-of-cvpointcross/?answer=12996#post-id-12996The cross product which returns double for point is defined as follow:
P1.x*P2.y - P1.y * P2.x;
This is known as the magnitude, and it's similar to take the cross product on the XY plane (Z = 0).
Some more explanations [here](http://stackoverflow.com/questions/243945/calculating-a-2d-vectors-cross-product).Tue, 07 May 2013 03:31:57 -0500http://answers.opencv.org/question/12987/what-is-the-meaning-of-cvpointcross/?answer=12996#post-id-12996Comment by Adi for <p>The cross product which returns double for point is defined as follow:</p>
<pre><code>P1.x*P2.y - P1.y * P2.x;
</code></pre>
<p>This is known as the magnitude, and it's similar to take the cross product on the XY plane (Z = 0).
Some more explanations <a href="http://stackoverflow.com/questions/243945/calculating-a-2d-vectors-cross-product">here</a>.</p>
http://answers.opencv.org/question/12987/what-is-the-meaning-of-cvpointcross/?comment=13013#post-id-13013Interesting. In my question I actually meant if there is a projective or homogeneous interpretation.Tue, 07 May 2013 07:50:13 -0500http://answers.opencv.org/question/12987/what-is-the-meaning-of-cvpointcross/?comment=13013#post-id-13013