Exemple #1
0
    /// <summary>
    /// perform a test
    /// </summary>
    /// <param name="test_index">index number of the test to be performed</param>
    private void PerformTest(int test_index)
    {
        // initialise
        init();

        switch (test_index)
        {
        case 0:      // motion model
        {
            test_motion_model(true);
            break;
        }

        case 1:      // stereo ray models
        {
            bool mirror = false;
            stereo_model.showProbabilities(grid_layer,
                                           grid_dimension,
                                           img_rays, standard_width, standard_height,
                                           false, true, mirror);
            break;
        }

        case 2:      // gaussian distribution function
        {
            stereo_model.showDistribution(img_rays, standard_width, standard_height);
            break;
        }

        case 3:      // a single stereo ray model
        {
            createSingleRayModel(false);
            break;
        }

        case 4:      // sensor model lookups
        {
            createSensorModelLookup();
            break;
        }

        case 5:      // path planner
        {
            test_path_planner(200, 50);
            break;
        }
        }

        // make a larger image
        byte[] img_large = image.downSample(img_rays, standard_width, standard_height,
                                            standard_width * 2, standard_height * 2);

        // display the results
        imgOutput.Pixbuf = GtkBitmap.createPixbuf(standard_width * 2, standard_height * 2);
        GtkBitmap.setBitmap(img_large, imgOutput);
    }
Exemple #2
0
        private void gaussianFunctionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            grid_layer = new float[grid_dimension, grid_dimension, 3];

            pos3D_x = new float[4];
            pos3D_y = new float[4];

            stereo_model         = new stereoModel();
            robot_head           = new stereoHead(4);
            stereo_features      = new float[900];
            stereo_uncertainties = new float[900];

            img_rays      = new Byte[standard_width * standard_height * 3];
            rays          = new Bitmap(standard_width, standard_height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
            picRays.Image = rays;

            stereo_model.showDistribution(img_rays, standard_width, standard_height);

            BitmapArrayConversions.updatebitmap_unsafe(img_rays, (Bitmap)picRays.Image);
        }