コード例 #1
0
ファイル: HpolarTests.cs プロジェクト: williammc/sentience
        public void GroundPlaneUpdate()
        {
            int    image_width  = 320;
            int    image_height = 240;
            Hpolar map          = new Hpolar();

            map.footline         = new ushort[image_width / map.SVS_HORIZONTAL_SAMPLING];
            map.footline_dist_mm = new ushort[image_width / map.SVS_HORIZONTAL_SAMPLING];

            // create a footline
            for (int x = image_width * 20 / 100; x < image_width * 40 / 100; x++)
            {
                map.footline[x / map.SVS_HORIZONTAL_SAMPLING] = (ushort)(image_height / 2);
            }
            for (int x = image_width * 60 / 100; x < image_width * 80 / 100; x++)
            {
                map.footline[x / map.SVS_HORIZONTAL_SAMPLING] = (ushort)(image_height / 2);
            }

            map.GroundPlaneUpdate();

            Assert.AreEqual(image_height / 2, map.footline[(image_width / 2) / map.SVS_HORIZONTAL_SAMPLING]);
            Assert.AreEqual(image_height / 2, map.footline[(image_width - 1) / map.SVS_HORIZONTAL_SAMPLING]);
            Assert.AreEqual(image_height / 2, map.footline[0]);
        }
コード例 #2
0
ファイル: HpolarTests.cs プロジェクト: kasertim/sentience
        public void GroundPlaneUpdate()
        {
            int image_width = 320;
            int image_height = 240;
            Hpolar map = new Hpolar();
            map.footline = new ushort[image_width / map.SVS_HORIZONTAL_SAMPLING];
            map.footline_dist_mm = new ushort[image_width / map.SVS_HORIZONTAL_SAMPLING];

            // create a footline
            for (int x = image_width*20/100; x < image_width*40/100; x++)
                map.footline[x / map.SVS_HORIZONTAL_SAMPLING] = (ushort)(image_height/2);
            for (int x = image_width*60/100; x < image_width*80/100; x++)
                map.footline[x / map.SVS_HORIZONTAL_SAMPLING] = (ushort)(image_height/2);
            
            map.GroundPlaneUpdate();

            Assert.AreEqual(image_height/2, map.footline[(image_width/2) / map.SVS_HORIZONTAL_SAMPLING]);
            Assert.AreEqual(image_height/2, map.footline[(image_width-1) / map.SVS_HORIZONTAL_SAMPLING]);
            Assert.AreEqual(image_height/2, map.footline[0]);
        }