Пример #1
0
        private void ErrorOfKComputation_Click(object sender, RoutedEventArgs e)
        {
            PlotFunctionForErrors(() =>
            {
                var F        = ComputeF();
                var Kest     = EstimateCameraFromImagePair.K(F, px * 2, py * 2);
                double error = (Kest - K).Norm / (fx + fy);

                return(error);
            }, "|fx - fy_est|+|fy - fy_est| / (fx + fy)");
        }
Пример #2
0
        public void ProcessImages(Mat left, Mat right, Feature2D detector, Feature2D descriptor, DistanceType distanceType, double takeBest)
        {
            var match = MatchImagePair.Match(left, right, detector, descriptor, distanceType, 20.0);

            DrawFeatures(left, right, match, takeBest);

            var lps = match.LeftPointsList.Take((int)(match.LeftPoints.Size * takeBest));
            var rps = match.RightPointsList.Take((int)(match.RightPoints.Size * takeBest));

            var F = ComputeMatrix.F(new VectorOfPointF(lps.ToArray()), new VectorOfPointF(rps.ToArray()));
            var K = EstimateCameraFromImagePair.K(F, left.Width, right.Height);
            var E = ComputeMatrix.E(F, K);

            FindTransformation.DecomposeToRTAndTriangulate(lps.ToList(), rps.ToList(), K, E,
                                                           out Image <Arthmetic, double> R, out Image <Arthmetic, double> t, out Image <Arthmetic, double> X);
            PrintMatricesInfo(E, K, R, t);
        }