Ejemplo n.º 1
0
        private void Save(Chessboard chessboard, Vector3[] fourImageCorners)
        {
            var df = new DictionaryFile();

            df.Set("tileCount.Width", chessboard.TileCount.Width);
            df.Set("tileCount.Height", chessboard.TileCount.Height);

            df.Set("imageCorner0.X", fourImageCorners[0].X);
            df.Set("imageCorner0.Y", fourImageCorners[0].Y);
            df.Set("imageCorner1.X", fourImageCorners[1].X);
            df.Set("imageCorner1.Y", fourImageCorners[1].Y);
            df.Set("imageCorner2.X", fourImageCorners[2].X);
            df.Set("imageCorner2.Y", fourImageCorners[2].Y);
            df.Set("imageCorner3.X", fourImageCorners[3].X);
            df.Set("imageCorner3.Y", fourImageCorners[3].Y);

            using (var sw = File.CreateText(FourCornersPath))
                df.Save(sw);
        }
Ejemplo n.º 2
0
        private static void Save(Chessboard chessboard, PointF[] projectorQuadCorners)
        {
            var df = new DictionaryFile();

            df.Set("tileCount.Width", chessboard.TileCount.Width);
            df.Set("tileCount.Height", chessboard.TileCount.Height);

            df.Set("corner0.X", projectorQuadCorners[0].X);
            df.Set("corner0.Y", projectorQuadCorners[0].Y);
            df.Set("corner1.X", projectorQuadCorners[1].X);
            df.Set("corner1.Y", projectorQuadCorners[1].Y);
            df.Set("corner2.X", projectorQuadCorners[2].X);
            df.Set("corner2.Y", projectorQuadCorners[2].Y);
            df.Set("corner3.X", projectorQuadCorners[3].X);
            df.Set("corner3.Y", projectorQuadCorners[3].Y);

            using (var sw = File.CreateText(FourCornersPath))
                df.Save(sw);
        }
Ejemplo n.º 3
0
        public void Save(string name, string uuid, Stream s)
        {
            using (var sw = new StreamWriter(s))
            {
                var df = new DictionaryFile();

                df.Set("Lens.K1", Lens.DistortionCoeffs[CoefficientIndexOfK1, 0]);
                df.Set("Lens.K2", Lens.DistortionCoeffs[CoefficientIndexOfK2, 0]);
                df.Set("Lens.K3", Lens.DistortionCoeffs[CoefficientIndexOfK3, 0]);

                df.Set("Lens.Cx", Lens.IntrinsicMatrix[0, 2] / ImageSize.Width);
                df.Set("Lens.Cy", Lens.IntrinsicMatrix[1, 2] / ImageSize.Height);

                df.Set("Lens.Fx", Lens.IntrinsicMatrix[0, 0] / ImageSize.Width);
                df.Set("Lens.Fy", Lens.IntrinsicMatrix[1, 1] / ImageSize.Height);

                df.Set("Name", name);
                df.Set("UUID", uuid);

                df.Set("Image.Width", ImageSize.Width);
                df.Set("Image.Height", ImageSize.Height);
                df.Set("Image.Focal.Length", FocalLength);
                df.Set("Image.AspectRatio", ImageAspectRatio);
                df.Set("Pixel.AspectRatio", PixelAspectRatio);
                df.Set("Reprojection.Error", ReprojectionError);

                df.Set("HorizontalFieldOfView", HorizontalFov);
                df.Set("VerticalFieldOfView", VerticalFov);

                df.Set("NearPlaneDistance", NearPlaneDistance);
                df.Set("FarPlaneDistance", FarPlaneDistance);

                df.Set("Principal.X", PrincipalPoint.X);
                df.Set("Principal.Y", PrincipalPoint.Y);

                df.Save(sw);
            }
        }