Exemple #1
0
        void LocateObstacle()
        {
            int[] index = new int[4000 * sizeof(double)];
            int[] nonzero = new int[4000 * sizeof(double)];
            int[] depth = new int[4000 * sizeof(double)];
            int   i = 0, temp = 0;

            if (mode != "Spiral")
            {
                graph = new Form1();
                graph.Show();
                for (i = 11; i < (0x1FFF / 4); i++)
                {
                    if (count[i] != 0)
                    {
                        nonzero[temp] = count[i];
                        depth[temp]   = i;
                        temp++;
                    }
                }
                graph.DrawChart(count); //use count to plot original
                graph.DrawChart2(nonzero);
            }
            //textBox3.Text = Convert.ToString(Array.BinarySearch(count, count.Max()));
            //textBox3.Text = Convert.ToString(Array.Find(count, EqualToMax));
            if (mode == "AllObstacles")
            {
                GetLocalMin(count);
            }
            else if (mode == "Cloud")
            {
                window1 = new Window1();
                window1.Show();
                window1.DrawCloud(distancepixel);
            }

            else
            {
                DrawObstacle(source, colorframe);
            }
        }