Computer Vision News - April 2016

Trick A second way is to calculate the determinant. If we take a closer look at the result we got above, we will notice that the components of the X and Y axis are always zero and it's just the Z axis that is necessary for our calculation. Computing the Z axis is just the determinant of our original 2D vectors in the XY image plane. Therefore, if the determinant is positive, the points were drawn in a clockwise direction; otherwise, they were drawn in anti-clockwise direction. In case the points are not created in the shape of a convex polygon, this process should be repeated for every pair of adjacent points. Only when the sum of all Z values is found positive, we can deduce that the marked points are in a clockwise direction. COMPUTER VISION NEWS 15 If the points were marked anti-clockwise, we would get the vectors A =[-131, -77, 0] and B =[-43, -70, 0] and their Cartesian product is [0, 0, -5859], with a negative value at the Z-axis as shown in the following figure. The Cartesian product of our two vectors A and B is the vector [0, 0, 5859] which has a positive Z axis, being 5859 greater than zero :-) ! We can thus determine that the points were marked in clockwise direction.

RkJQdWJsaXNoZXIy NTc3NzU=