Beispiel #1
0
        public PinholeToPlaneProjection(Point2D focalLength,
                                        Point2D principalPoint,
                                        DistortionParameters distortionParameters,
                                        Vector3D translationVector,
                                        Matrix3X3 rotationMatrix)
        {
            imageCoordinateNormalizer = new ImageCoordinateNormalizer(focalLength, principalPoint, distortionParameters);
            var imagePlane3D = new Plane(
                new Point3D(0, 0, 0),
                new Vector3D(1, 0, 0),
                new Vector3D(0, 1, 0));

            imagePlaneEmbeddingTransform = new Embed2DIn3DTransform(imagePlane3D);

            var planeVector1 = new Vector3D(rotationMatrix.Data
                                            .Multiply(new double[] { 1, 0, 0 }.ConvertToMatrix())
                                            .Vectorize());
            var planeVector2 = new Vector3D(rotationMatrix.Data
                                            .Multiply(new double[] { 0, 1, 0 }.ConvertToMatrix())
                                            .Vectorize());
            var plane = new Plane(translationVector.ToPoint3D(),
                                  planeVector1,
                                  planeVector2);

            planeEmbeddingTransform = new Embed2DIn3DTransform(plane);
            var pinHoleProjectionPoint = new Point3D(0, 0, -1);

            planeProjection      = new PlaneProjection(pinHoleProjectionPoint, plane);
            imagePlaneProjection = new PlaneProjection(pinHoleProjectionPoint, imagePlane3D);
        }
 public ImageCoordinateNormalizer(Point2D focalLength, Point2D principalPoint, DistortionParameters distortionParameters)
 {
     this.focalLength          = focalLength;
     this.principalPoint       = principalPoint;
     this.distortionParameters = distortionParameters;
 }