Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new detection result
 /// </summary>
 /// <param name="marker">A reference to the found marker.</param>
 /// <param name="confidence">The confidence / quality  of the result.</param>
 /// <param name="transformation">The transformation matrix for the marker.</param>
 /// <param name="square">The pixel coordinates where the square marker was found. </param>
 public DetectionResult(Marker marker, double confidence, Matrix3D transformation, Square square)
 {
    this.Marker          = marker;
    this.Confidence      = confidence;
    this.Transformation  = transformation;
    this.Square          = square;
 }
Ejemplo n.º 2
0
 private static Matrix3D CreateIdentity()
 {
     Matrix3D matrix3D = new Matrix3D();
     matrix3D.SetMatrix(1, 0, 0, 0,
                        0, 1, 0, 0,
                        0, 0, 1, 0,
                        0, 0, 0, 1);
     return matrix3D;
 }
Ejemplo n.º 3
0
 private static bool Equals(Matrix3D matrix1, Matrix3D matrix2)
 {
     return matrix1.M11.Equals(matrix2.M11) &&
            matrix1.M12.Equals(matrix2.M12) &&
            matrix1.M13.Equals(matrix2.M13) &&
            matrix1.M14.Equals(matrix2.M14) &&
            matrix1.M21.Equals(matrix2.M21) &&
            matrix1.M22.Equals(matrix2.M22) &&
            matrix1.M23.Equals(matrix2.M23) &&
            matrix1.M24.Equals(matrix2.M24) &&
            matrix1.M31.Equals(matrix2.M31) &&
            matrix1.M32.Equals(matrix2.M32) &&
            matrix1.M33.Equals(matrix2.M33) &&
            matrix1.M34.Equals(matrix2.M34) &&
            matrix1.OffsetX.Equals(matrix2.OffsetX) &&
            matrix1.OffsetY.Equals(matrix2.OffsetY) &&
            matrix1.OffsetZ.Equals(matrix2.OffsetZ) &&
            matrix1.M44.Equals(matrix2.M44);
 }
Ejemplo n.º 4
0
 public bool Equals(Matrix3D value)
 {
     return Matrix3D.Equals(this, value);
 }
Ejemplo n.º 5
0
        public static Matrix3D operator *(Matrix3D matrix1, Matrix3D matrix2)
        {
            Matrix3D matrix3D = new Matrix3D();

            matrix3D.M11 = matrix1.M11 * matrix2.M11 +
                           matrix1.M12 * matrix2.M21 +
                           matrix1.M13 * matrix2.M31 +
                           matrix1.M14 * matrix2.OffsetX;
            matrix3D.M12 = matrix1.M11 * matrix2.M12 +
                           matrix1.M12 * matrix2.M22 +
                           matrix1.M13 * matrix2.M32 +
                           matrix1.M14 * matrix2.OffsetY;
            matrix3D.M13 = matrix1.M11 * matrix2.M13 +
                           matrix1.M12 * matrix2.M23 +
                           matrix1.M13 * matrix2.M33 +
                           matrix1.M14 * matrix2.OffsetZ;
            matrix3D.M14 = matrix1.M11 * matrix2.M14 +
                           matrix1.M12 * matrix2.M24 +
                           matrix1.M13 * matrix2.M34 +
                           matrix1.M14 * matrix2.M44;
            matrix3D.M21 = matrix1.M21 * matrix2.M11 +
                           matrix1.M22 * matrix2.M21 +
                           matrix1.M23 * matrix2.M31 +
                           matrix1.M24 * matrix2.OffsetX;
            matrix3D.M22 = matrix1.M21 * matrix2.M12 +
                           matrix1.M22 * matrix2.M22 +
                           matrix1.M23 * matrix2.M32 +
                           matrix1.M24 * matrix2.OffsetY;
            matrix3D.M23 = matrix1.M21 * matrix2.M13 +
                           matrix1.M22 * matrix2.M23 +
                           matrix1.M23 * matrix2.M33 +
                           matrix1.M24 * matrix2.OffsetZ;
            matrix3D.M24 = matrix1.M21 * matrix2.M14 +
                           matrix1.M22 * matrix2.M24 +
                           matrix1.M23 * matrix2.M34 +
                           matrix1.M24 * matrix2.M44;
            matrix3D.M31 = matrix1.M31 * matrix2.M11 +
                           matrix1.M32 * matrix2.M21 +
                           matrix1.M33 * matrix2.M31 +
                           matrix1.M34 * matrix2.OffsetX;
            matrix3D.M32 = matrix1.M31 * matrix2.M12 +
                           matrix1.M32 * matrix2.M22 +
                           matrix1.M33 * matrix2.M32 +
                           matrix1.M34 * matrix2.OffsetY;
            matrix3D.M33 = matrix1.M31 * matrix2.M13 +
                           matrix1.M32 * matrix2.M23 +
                           matrix1.M33 * matrix2.M33 +
                           matrix1.M34 * matrix2.OffsetZ;
            matrix3D.M34 = matrix1.M31 * matrix2.M14 +
                           matrix1.M32 * matrix2.M24 +
                           matrix1.M33 * matrix2.M34 +
                           matrix1.M34 * matrix2.M44;
            matrix3D.OffsetX = matrix1.OffsetX * matrix2.M11 +
                           matrix1.OffsetY * matrix2.M21 +
                           matrix1.OffsetZ * matrix2.M31 +
                           matrix1.M44 * matrix2.OffsetX;
            matrix3D.OffsetY = matrix1.OffsetX * matrix2.M12 +
                           matrix1.OffsetY * matrix2.M22 +
                           matrix1.OffsetZ * matrix2.M32 +
                           matrix1.M44 * matrix2.OffsetY;
            matrix3D.OffsetZ = matrix1.OffsetX * matrix2.M13 +
                           matrix1.OffsetY * matrix2.M23 +
                           matrix1.OffsetZ * matrix2.M33 +
                           matrix1.M44 * matrix2.OffsetZ;
            matrix3D.M44 = matrix1.OffsetX * matrix2.M14 +
                           matrix1.OffsetY * matrix2.M24 +
                           matrix1.OffsetZ * matrix2.M34 +
                           matrix1.M44 * matrix2.M44;

            // matrix3D._type is not set.

            return matrix3D;
        }
 private static void ApplyMatrix(ref Matrix3D matrix, JArray values)
 {
     matrix.M11 = values.Value<double>(0);
     matrix.M12 = values.Value<double>(1);
     matrix.M13 = values.Value<double>(2);
     matrix.M14 = values.Value<double>(3);
     matrix.M21 = values.Value<double>(4);
     matrix.M22 = values.Value<double>(5);
     matrix.M23 = values.Value<double>(6);
     matrix.M24 = values.Value<double>(7);
     matrix.M31 = values.Value<double>(8);
     matrix.M32 = values.Value<double>(9);
     matrix.M33 = values.Value<double>(10);
     matrix.M34 = values.Value<double>(11);
     matrix.OffsetX = values.Value<double>(12);
     matrix.OffsetY = values.Value<double>(13);
     matrix.OffsetZ = values.Value<double>(14);
     matrix.M44 = values.Value<double>(15);
 }
Ejemplo n.º 7
0
        public static Matrix3D operator *(Matrix3D matrix1, Matrix3D matrix2)
        {
            Matrix3D matrix3D = default;

            matrix3D.M11 = matrix1.M11 * matrix2.M11 +
                           matrix1.M12 * matrix2.M21 +
                           matrix1.M13 * matrix2.M31 +
                           matrix1.M14 * matrix2.OffsetX;
            matrix3D.M12 = matrix1.M11 * matrix2.M12 +
                           matrix1.M12 * matrix2.M22 +
                           matrix1.M13 * matrix2.M32 +
                           matrix1.M14 * matrix2.OffsetY;
            matrix3D.M13 = matrix1.M11 * matrix2.M13 +
                           matrix1.M12 * matrix2.M23 +
                           matrix1.M13 * matrix2.M33 +
                           matrix1.M14 * matrix2.OffsetZ;
            matrix3D.M14 = matrix1.M11 * matrix2.M14 +
                           matrix1.M12 * matrix2.M24 +
                           matrix1.M13 * matrix2.M34 +
                           matrix1.M14 * matrix2.M44;
            matrix3D.M21 = matrix1.M21 * matrix2.M11 +
                           matrix1.M22 * matrix2.M21 +
                           matrix1.M23 * matrix2.M31 +
                           matrix1.M24 * matrix2.OffsetX;
            matrix3D.M22 = matrix1.M21 * matrix2.M12 +
                           matrix1.M22 * matrix2.M22 +
                           matrix1.M23 * matrix2.M32 +
                           matrix1.M24 * matrix2.OffsetY;
            matrix3D.M23 = matrix1.M21 * matrix2.M13 +
                           matrix1.M22 * matrix2.M23 +
                           matrix1.M23 * matrix2.M33 +
                           matrix1.M24 * matrix2.OffsetZ;
            matrix3D.M24 = matrix1.M21 * matrix2.M14 +
                           matrix1.M22 * matrix2.M24 +
                           matrix1.M23 * matrix2.M34 +
                           matrix1.M24 * matrix2.M44;
            matrix3D.M31 = matrix1.M31 * matrix2.M11 +
                           matrix1.M32 * matrix2.M21 +
                           matrix1.M33 * matrix2.M31 +
                           matrix1.M34 * matrix2.OffsetX;
            matrix3D.M32 = matrix1.M31 * matrix2.M12 +
                           matrix1.M32 * matrix2.M22 +
                           matrix1.M33 * matrix2.M32 +
                           matrix1.M34 * matrix2.OffsetY;
            matrix3D.M33 = matrix1.M31 * matrix2.M13 +
                           matrix1.M32 * matrix2.M23 +
                           matrix1.M33 * matrix2.M33 +
                           matrix1.M34 * matrix2.OffsetZ;
            matrix3D.M34 = matrix1.M31 * matrix2.M14 +
                           matrix1.M32 * matrix2.M24 +
                           matrix1.M33 * matrix2.M34 +
                           matrix1.M34 * matrix2.M44;
            matrix3D.OffsetX = matrix1.OffsetX * matrix2.M11 +
                               matrix1.OffsetY * matrix2.M21 +
                               matrix1.OffsetZ * matrix2.M31 +
                               matrix1.M44 * matrix2.OffsetX;
            matrix3D.OffsetY = matrix1.OffsetX * matrix2.M12 +
                               matrix1.OffsetY * matrix2.M22 +
                               matrix1.OffsetZ * matrix2.M32 +
                               matrix1.M44 * matrix2.OffsetY;
            matrix3D.OffsetZ = matrix1.OffsetX * matrix2.M13 +
                               matrix1.OffsetY * matrix2.M23 +
                               matrix1.OffsetZ * matrix2.M33 +
                               matrix1.M44 * matrix2.OffsetZ;
            matrix3D.M44 = matrix1.OffsetX * matrix2.M14 +
                           matrix1.OffsetY * matrix2.M24 +
                           matrix1.OffsetZ * matrix2.M34 +
                           matrix1.M44 * matrix2.M44;

            // matrix3D._type is not set.

            return(matrix3D);
        }
Ejemplo n.º 8
0
 public bool Equals(Matrix3D value)
 {
     return(Matrix3D.Equals(this, value));
 }
Ejemplo n.º 9
0
 public override bool Equals(object?o)
 {
     return(o is Matrix3D && Matrix3D.Equals(this, (Matrix3D)o));
 }
Ejemplo n.º 10
0
 public bool Equals(Matrix3D value)
 {
     throw new NotImplementedException();
 }