コード例 #1
0
ファイル: robot.cs プロジェクト: williammc/sentience
        /// <summary>
        /// Make a measurement of a feature. This function calls elliptical_search() to
        /// find the best match within three standard deviations of the predicted location.
        /// </summary>
        /// <param name="patch">The identifier for this feature (in this case an image patch)</param>
        /// <param name="z">The best image location match for the feature, to be filled in by this function</param>
        /// <param name="h">The expected image location</param>
        /// <param name="S">The expected location covariance, used to specify the search region.</param>
        /// <returns></returns>
        public override bool measure_feature(byte[] patch,
                                             int patchwidth,
                                             ref Vector z,
                                             Vector vz,
                                             Vector h,
                                             MatrixFixed S,
                                             Random rnd)
        {
            Cholesky    S_cholesky = new Cholesky(S);
            MatrixFixed Sinv       = S_cholesky.Inverse();

            uint u_found = 0, v_found = 0;

            if (SceneLib.elliptical_search(image, image_width, image_height,
                                           patch, patchwidth, patchwidth,
                                           h, Sinv,
                                           ref u_found,
                                           ref v_found,
                                           vz,
                                           Camera_Constants.BOXSIZE,
                                           outputimage,
                                           outputimage_width, outputimage_height,
                                           show_ellipses,
                                           calibrating,
                                           rnd) != true)
            {
                // Feature not successfully matched
                return(false);
            }

            z.Put(0, (float)u_found);
            z.Put(1, (float)v_found);

            return(true);
        }
コード例 #2
0
        public void ShouldInverse()
        {
            var a = new Matrix(new double[, ]
            {
                { 4, 12, -16 },
                { 12, 37, -43 },
                { -16, -43, 98 }
            });

            var m1 = Cholesky.Inverse(a);
        }