Esempio n. 1
0
        private void initLRA(Vector<double> firstFeatures, int featureCount)
        {
            threshold = Convert.ToDouble(epsilon.Text.Replace('.',','));

            E = firstFeatures.ToColumnMatrix();

            var m = 1 / firstFeatures.DotProduct(firstFeatures); 
            M = DenseMatrix.Create(1,1,m);

            mask = null;
            mask = new List<int>();
        }
        private void computeTransform()
        {
            Func<SkeletonPoint, Vector<double>> conv = (sp) => new DenseVector(new double[] { sp.X, sp.Y, sp.Z });
            p0 = conv(dBlue.Value);
            var p1 = conv(dRed.Value);
            var p2 = conv(dYellow.Value);

            f2 = (p1 - p0).Normalize(1);
            f1 = (p2 - p0).Normalize(1);
            f1 = (f1 - (f1.DotProduct(f2) * f2)).Normalize(1);
            f3 = new DenseVector(new double[] { f1[1] * f2[2] - f1[2] * f2[1], f1[2] * f2[0] - f1[0] * f2[2], f1[0] * f2[1] - f1[1] * f2[0] });
            f3 = f3.Normalize(1);
            IsValid = true;
        }