コード例 #1
0
        /// <summary>
        /// Called when the class is initialized. Creates many of the arrays and sets many of the values.
        /// </summary>
        public override void Initialize()
        {
            // Create the arrays needed. Building them now will save CPU later.
            this.trueFalseMap  = new bool[this.screenWidth, this.screenHeight];
            this.trueFalseMapB = new bool[this.screenWidth, this.screenHeight];
            this.trueFalseMapC = new bool[this.screenWidth, this.screenHeight];

            this.accum2       = new short[360 / ThetaIncrement, AccumLength / RhoIncrement]; // Build the accumlator array. Make is smaller or shorter based on the size of the rho and theta increments
            this.accum1       = new short[360 / ThetaIncrement, AccumLengthOld / RhoIncrement];
            this.colorArray1D = new Color[this.screenWidth * this.screenHeight];             // Create a 1D array of color
            this.colorArray   = new Color[this.screenWidth, this.screenHeight];              // Create a 2D array of color

            this.houghInfo        = new double[(11 * NumberofLinesToFind) + 5];              // Make the array to store hough information. Must be double so that slopes which are fractions can be stored
            this.houghInformation = new HoughInformation(NumberofLinesToFind);

            this.lineArray = new Line[NumberofLinesToFind];

            for (int i = 0; i < NumberofLinesToFind; i++)
            {
                this.lineArray[i] = new Line();
            }

            // Set the color thresholds
            this.redGood   = this.whiteParam;
            this.blueGood  = this.whiteParam;
            this.greenGood = this.whiteParam;

            this.houghLineStartandStopVectors = new Vector3[NumberofLinesToFind * 4];
            for (int i = 0; i < NumberofLinesToFind * 4; i++)
            {
                this.houghLineStartandStopVectors[i] = Vector3.Zero;
            }

            this.middleValues = new int[this.screenHeight]; // Steering desisions are based off the average middle clear value for each row

            base.Initialize();
        }
コード例 #2
0
        /// <summary>
        /// Called when the class is initialized. Creates many of the arrays and sets many of the values. 
        /// </summary>
        public override void Initialize()
        {
            // Create the arrays needed. Building them now will save CPU later.
            this.trueFalseMap = new bool[this.screenWidth, this.screenHeight];
            this.trueFalseMapB = new bool[this.screenWidth, this.screenHeight];
            this.trueFalseMapC = new bool[this.screenWidth, this.screenHeight];

            this.accum2 = new short[360 / ThetaIncrement, AccumLength / RhoIncrement]; // Build the accumlator array. Make is smaller or shorter based on the size of the rho and theta increments
            this.accum1 = new short[360 / ThetaIncrement, AccumLengthOld / RhoIncrement];
            this.colorArray1D = new Color[this.screenWidth * this.screenHeight]; // Create a 1D array of color
            this.colorArray = new Color[this.screenWidth, this.screenHeight]; // Create a 2D array of color

            this.houghInfo = new double[(11 * NumberofLinesToFind) + 5]; // Make the array to store hough information. Must be double so that slopes which are fractions can be stored
            this.houghInformation = new HoughInformation(NumberofLinesToFind);

            this.lineArray = new Line[NumberofLinesToFind];

            for (int i = 0; i < NumberofLinesToFind; i++)
            {
                this.lineArray[i] = new Line();
            }

            // Set the color thresholds
            this.redGood = this.whiteParam;
            this.blueGood = this.whiteParam;
            this.greenGood = this.whiteParam;

            this.houghLineStartandStopVectors = new Vector3[NumberofLinesToFind * 4];
            for (int i = 0; i < NumberofLinesToFind * 4; i++)
            {
                this.houghLineStartandStopVectors[i] = Vector3.Zero;
            }

            this.middleValues = new int[this.screenHeight]; // Steering desisions are based off the average middle clear value for each row

            base.Initialize();
        }