Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        private PointsCoordSet CalcKalmanOpt(PointsCoordSet list, string strName, Kalc3Dim KallFil, bool iIsPredict,
                                             bool bNoA, bool bIsX)
        {
            var listKalman = new PointsCoordSet(strName);
            var Num        = list[0].NumFrame - 1;

            for (var jc = 0; jc < list.Count; jc++)
            {
                var pt  = new Point(list[jc].X, list[jc].Y);
                var ptC = list[jc] + pt;
                ptC.col = Color.Fuchsia;
                if (list[jc].X == -1)
                {
                    ptC.col = Color.Yellow;
                }
                if (bIsX == true)
                {
                    var x = KallFil.SetData(list[jc].X, list[jc].NumFrame, iIsPredict, bNoA);
                    ptC.X = (int)x;
                }
                else
                {
                    var y = KallFil.SetData(list[jc].Y, list[jc].NumFrame, iIsPredict, bNoA);
                    ptC.Y = (int)y;
                }


                listKalman.Add(ptC);
            }
            //PointsCoordSet.AddList(listKalman);
            return(listKalman);
        }
Пример #2
0
        /// <summary>
        /// Работаем со скоростью
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        private void CalcKalmanV(List <PointCoords> list, string strName, bool iIsPredict, bool bNoA)
        {
            var listKalman = new PointsCoordSet(strName);

            if (list.Count <= 0)
            {
                return;
            }
            var KallFilX = new Kalc3Dim("X", true);
            var KallFilY = new Kalc3Dim("Y", false);
            var Num      = list[0].NumFrame - 1;

            for (var jc = 0; jc < list.Count; jc++)
            {
                var pt  = new Point(list[jc].X, list[jc].Y);
                var ptC = list[jc] + pt;
                ptC.col = Color.Fuchsia;
                if (list[jc].X == -1)
                {
                    ptC.col = Color.Yellow;
                }
                var x = KallFilX.SetData(list[jc].X, list[jc].NumFrame, iIsPredict, bNoA);
                var y = KallFilY.SetData(list[jc].Y, list[jc].NumFrame, iIsPredict, bNoA);
                ptC.X = (int)x;
                ptC.Y = (int)y;
                //PointCoords ptC = KallFil.CalcEstimationPoint(pt, list[jc].NumFrame) + list[jc];

                listKalman.Add(ptC);
            }
            PointsCoordSet.AddList(listKalman);
        }