void Init(synesis.CombinedMarkerCalibration cCalibration)
        {
            matrixFormat = new MatrixValue(synesis.MatrixFormat.Item1);

            if (cCalibration.CombinedMarkers.Count() != 1)
            {
                return;
            }

            physicalHeight = cCalibration.CombinedMarkers[0].Height;
            physicalWidth  = cCalibration.CombinedMarkers[0].Width;

            if (cCalibration.CombinedMarkers[0].Rectangles.Count() != 2)
            {
                return;
            }
            unitedMarker1 = new UnitedMarker(cCalibration.CombinedMarkers[0].Rectangles[0], 1);
            unitedMarker2 = new UnitedMarker(cCalibration.CombinedMarkers[0].Rectangles[1], 2);
        }
        void Init(synesis.HeightMarkerCalibration hCalibration)
        {
            FocalLength  = hCalibration.FocalLength;
            MatrixFormat = new MatrixValue(hCalibration.MatrixFormat);

            if (hCalibration.HeightMarkers.Count() != 1)
            {
                return;
            }

            physicalHeight = hCalibration.HeightMarkers[0].Height;
            physicalWidth  = physicalHeight;

            if (hCalibration.HeightMarkers[0].SurfaceNormals.Count() != 2)
            {
                return;
            }
            unitedMarker1 = new UnitedMarker(hCalibration.HeightMarkers[0].SurfaceNormals[0], 1);
            unitedMarker2 = new UnitedMarker(hCalibration.HeightMarkers[0].SurfaceNormals[1], 2);
        }
        void Init(synesis.CombinedMarkerCalibration cCalibration) {
            matrixFormat = new MatrixValue(synesis.MatrixFormat.Item1);
            
            if (cCalibration.CombinedMarkers.Count() != 1)
                return;

            physicalHeight = cCalibration.CombinedMarkers[0].Height;
            physicalWidth = cCalibration.CombinedMarkers[0].Width;

            if (cCalibration.CombinedMarkers[0].Rectangles.Count() != 2)
                return;
            unitedMarker1 = new UnitedMarker(cCalibration.CombinedMarkers[0].Rectangles[0], 1);
            unitedMarker2 = new UnitedMarker(cCalibration.CombinedMarkers[0].Rectangles[1], 2);
        }
        void Init(synesis.HeightMarkerCalibration hCalibration) {
            FocalLength = hCalibration.FocalLength;
            MatrixFormat = new MatrixValue(hCalibration.MatrixFormat);

            if (hCalibration.HeightMarkers.Count() != 1)
                return;

            physicalHeight = hCalibration.HeightMarkers[0].Height;
            physicalWidth = physicalHeight;

            if (hCalibration.HeightMarkers[0].SurfaceNormals.Count() != 2)
                return;
            unitedMarker1 = new UnitedMarker(hCalibration.HeightMarkers[0].SurfaceNormals[0], 1);
            unitedMarker2 = new UnitedMarker(hCalibration.HeightMarkers[0].SurfaceNormals[1], 2);
        }
        void CheckAndCorrect(UnitedMarker unitedMarker) {
            double topx = unitedMarker.Top.X;
            double topy = unitedMarker.Top.Y;
            double bottomx = unitedMarker.Bottom.X;
            double bottomy = unitedMarker.Bottom.Y;

            if (topx < 0)
                topx = 0;
            if (topy < 0)
                topy = 0;

            if (topx >= bountRct.Width) topx = bountRct.Width - 1;
            if (topy >= bountRct.Height) topy = bountRct.Height - 1;

            if (bottomx < 0) bottomx = 0;
            if (bottomy < 0) bottomy = 0;

            if (bottomx >= bountRct.Width) bottomx = bountRct.Width - 1;
            if (bottomy >= bountRct.Height) bottomy = bountRct.Height - 1;

            unitedMarker.Top = new OPoint() { X = topx, Y = topy};
            unitedMarker.Bottom = new OPoint() { X = bottomx, Y = bottomy };
        }
		public void Init(UnitedMarker unitedMarker, Size boundRect, Action bottomChanged) {
            this.bottomChanged = bottomChanged;
            this.uniMarker = unitedMarker;
            bountRct = boundRect;

            CheckAndCorrect(uniMarker);

            Display();
		}
        public void Init(UnitedMarkerCalibration uniCalibration, UnitedMarker unitedMarker, Size boundRect, Action bottomChanged, Action<int, bool> ScaleInfo) {
            this.bottomChanged = bottomChanged;
            this.ScaleInfo = ScaleInfo;
            uniMarker = unitedMarker;
            this.uniCalibration = uniCalibration;
            bountRct = boundRect;

            numtext.Text = uniMarker.ID.ToString();
            CheckAndCorrect(uniMarker);

			Display();
		}