//---------------------------------------------------------------------------------------------
        //Матрица вращения для точек окружности
        private RealMatrix GetRotationMatrix(Point3D[] circlePoints)
        {
            //PlaneDescriptor circlePointsPlane = this.GetPlane( circlePoints );

            PlaneApproximator planeApproximator = new PlaneApproximator();
            PlaneDescriptor   circlePointsPlane = planeApproximator.Approximate(circlePoints);

            this.CirclePointsPlane = circlePointsPlane; //debug

            RealVector circlePointsPlaneNormalVector = circlePointsPlane.GetNormalVector();
            RealVector vectorN        = new RealVector(1, 1, 1);
            RealMatrix rotationMatrix = SpaceManager.GetRotationMatrixToTargetVector
                                            (circlePointsPlaneNormalVector, vectorN);

            return(rotationMatrix);
        }
Beispiel #2
0
        //------------------------------------------------------------------------------------------
        //------------------------------------------------------------------------------------------
        //------------------------------------------------------------------------------------------

        /*
         * //Значение целевой функции для интерферограмм при определенном значении гамма
         * //( Расстояния до средней точки )
         * private double GetTargetFunctionValue(
         *  double gamma, RealMatrix[] interferograms, BitMask2D bitMask
         * ) {
         *  RealMatrix[] gammaCorrectedInterferograms =
         *      this.GetGammaCorrectedInterferograms( gamma, interferograms );
         *  Point3D[] points = this.GetSpatialPoints( gammaCorrectedInterferograms, bitMask );
         *  Point3D midPoint = SpaceManager.GetMidPoint( points );
         *  double[] distancesFromPointsToMidPoint = SpaceManager.GetDistances( points, midPoint );
         *  double averageDistance = distancesFromPointsToMidPoint.Average();
         *  double targetFunctionValue =
         *      this.CalculateTargetFunctionValue( averageDistance, distancesFromPointsToMidPoint );
         *  return targetFunctionValue;
         * }
         */
        //------------------------------------------------------------------------------------------
        //Значение целевой функции для интерферограмм при определенном значении гамма
        //( Аппроксимация плоскостью - вычисление невязки )
        private double GetTargetFunctionValue(
            double gamma, RealMatrix[] interferograms, BitMask2D bitMask
            )
        {
            RealMatrix[] gammaCorrectedInterferograms =
                this.GetGammaCorrectedInterferograms(gamma, interferograms);
            Point3D[]         points            = this.GetSpatialPoints(gammaCorrectedInterferograms, bitMask);
            PlaneApproximator planeApproximator = new PlaneApproximator();
            PlaneDescriptor   planeDescriptor   = planeApproximator.Approximate(points);

            double[] misalignments       = planeDescriptor.GetPointsMisalignments(points);
            double   averageMisalignment = misalignments.Average();
            double   targetFunctionValue =
                this.CalculateTargetFunctionValue(averageMisalignment, misalignments);

            return(targetFunctionValue);
        }