diff --git a/modules/calib3d/src/usac/degeneracy.cpp b/modules/calib3d/src/usac/degeneracy.cpp index 6ccf2bb497ee4a2f66e18347c06bdb8efc82d601..bf5ec2b1101cdfbc243038042b154012276fcf2a 100644 --- a/modules/calib3d/src/usac/degeneracy.cpp +++ b/modules/calib3d/src/usac/degeneracy.cpp @@ -112,7 +112,7 @@ public: return false; // Checks if points are not collinear - // If area of triangle constructed with 3 points is less then threshold then points are collinear: + // If area of triangle constructed with 3 points is less than threshold then points are collinear: // |x1 y1 1| |x1 y1 1| // (1/2) det |x2 y2 1| = (1/2) det |x2-x1 y2-y1 0| = det |x2-x1 y2-y1| < 2 * threshold // |x3 y3 1| |x3-x1 y3-y1 0| |x3-x1 y3-y1| diff --git a/modules/calib3d/src/usac/essential_solver.cpp b/modules/calib3d/src/usac/essential_solver.cpp index 6dad2a4b883817094cbfd21a9dfac7230594ef64..504fec6ab533be1974861ad2be4842c9cc35704b 100644 --- a/modules/calib3d/src/usac/essential_solver.cpp +++ b/modules/calib3d/src/usac/essential_solver.cpp @@ -142,7 +142,7 @@ public: } std::vector c(11), rs; - // filling coefficients of 10-degree polynomial satysfying zero-determinant constraint of essential matrix, ie., det(E) = 0 + // filling coefficients of 10-degree polynomial satisfying zero-determinant constraint of essential matrix, ie., det(E) = 0 // based on "An Efficient Solution to the Five-Point Relative Pose Problem" (David Nister) // same as in five-point.cpp c[10] = (b[0]*b[17]*b[34]+b[26]*b[4]*b[21]-b[26]*b[17]*b[8]-b[13]*b[4]*b[34]-b[0]*b[21]*b[30]+b[13]*b[30]*b[8]); diff --git a/modules/calib3d/src/usac/fundamental_solver.cpp b/modules/calib3d/src/usac/fundamental_solver.cpp index 4083b7610283546c8cfdab920dd1d0dba13cbc8c..a5e3b30fba96e46288e30467f0587d74b2329540 100644 --- a/modules/calib3d/src/usac/fundamental_solver.cpp +++ b/modules/calib3d/src/usac/fundamental_solver.cpp @@ -438,7 +438,7 @@ public: explicit CovarianceEpipolarSolverImpl (const Mat &points_, bool is_fundamental_) { points_size = points_.rows; is_fundamental = is_fundamental_; - if (is_fundamental) { // normalize image points only for fundmantal matrix + if (is_fundamental) { // normalize image points only for fundamental matrix std::vector sample(points_size); for (int i = 0; i < points_size; i++) sample[i] = i; const Ptr normTr = NormTransform::create(points_); @@ -558,7 +558,7 @@ public: const auto * const pts_ = (float *) calib_points.data; // a few point are enough to test // actually due to Sampson error minimization, the input R,t do not really matter - // for a correct pair there is a sligthly faster convergence + // for a correct pair there is a slightly faster convergence for (int i = 0; i < 3; i++) { // could be 1 point const int rand_inl = 4 * sample[rng.uniform(0, sample_size)]; Vec3d p1 (pts_[rand_inl], pts_[rand_inl+1], 1), p2(pts_[rand_inl+2], pts_[rand_inl+3], 1); diff --git a/modules/calib3d/src/usac/pnp_solver.cpp b/modules/calib3d/src/usac/pnp_solver.cpp index b7b136d1e2fe62d6bb860f5e890721d62de24fbf..db0477090863c759e9f7c41e04966e49930180c2 100644 --- a/modules/calib3d/src/usac/pnp_solver.cpp +++ b/modules/calib3d/src/usac/pnp_solver.cpp @@ -196,7 +196,7 @@ public: a2[10] = v * Z; a2[11] = v; - // fill covarinace matrix + // fill covariance matrix for (int j = 0; j < 12; j++) for (int z = j; z < 12; z++) AtA[j * 12 + z] += a1[j] * a1[z] + a2[j] * a2[z]; @@ -227,7 +227,7 @@ public: a2[10] = v * weight_Z; a2[11] = v * weight; - // fill covarinace matrix + // fill covariance matrix for (int j = 0; j < 12; j++) for (int z = j; z < 12; z++) AtA[j * 12 + z] += a1[j] * a1[z] + a2[j] * a2[z]; diff --git a/modules/calib3d/src/usac/ransac_solvers.cpp b/modules/calib3d/src/usac/ransac_solvers.cpp index 1a7635333152003656b476e69fb00ab1f59894f4..28620c0b3f151be83c00f3806e0b61403c23c978 100644 --- a/modules/calib3d/src/usac/ransac_solvers.cpp +++ b/modules/calib3d/src/usac/ransac_solvers.cpp @@ -294,7 +294,7 @@ public: params->getUpperIncompleteOfSigmaQuantile()); break; case ScoreMethod::SCORE_METHOD_LMEDS : quality = LMedsQuality::create(points_size, threshold, error); break; - default: CV_Error(cv::Error::StsNotImplemented, "Score is not imeplemeted!"); + default: CV_Error(cv::Error::StsNotImplemented, "Score is not implemented!"); } const auto is_ge_solver = params->getRansacSolver() == GEM_SOLVER; diff --git a/modules/calib3d/src/usac/sampler.cpp b/modules/calib3d/src/usac/sampler.cpp index 2095ee8b4da6390d81ff468c42c679c48a1a3469..1938bde918bcd531f5b629f03d714032cfd93a1c 100644 --- a/modules/calib3d/src/usac/sampler.cpp +++ b/modules/calib3d/src/usac/sampler.cpp @@ -62,8 +62,8 @@ Ptr UniformSampler::create(int state, int sample_size_, int poin /////////////////////////////////// PROSAC (SIMPLE) SAMPLER /////////////////////////////////////// /* * PROSAC (simple) sampler does not use array of precalculated T_n (n is subset size) samples, but computes T_n for -* specific n directy in generateSample() function. -* Also, the stopping length (or maximum subset size n*) by default is set to points_size (N) and does not updating +* specific n directly in generateSample() function. +* Also, the stopping length (or maximum subset size n*) by default is set to points_size (N) and does not update * during computation. */ class ProsacSimpleSamplerImpl : public ProsacSimpleSampler { @@ -176,7 +176,7 @@ protected: // In our experiments, the parameter was set to T_N = 200000 int growth_max_samples; - // how many time PROSAC generateSample() was called + // how many times PROSAC generateSample() was called int kth_sample_number; Ptr random_gen; public: @@ -488,7 +488,7 @@ public: points_large_neighborhood_size = 0; - // find indicies of points that have sufficient neighborhood (at least sample_size-1) + // find indices of points that have sufficient neighborhood (at least sample_size-1) for (int pt_idx = 0; pt_idx < points_size; pt_idx++) if ((int)neighborhood_graph->getNeighbors(pt_idx).size() >= sample_size-1) points_large_neighborhood[points_large_neighborhood_size++] = pt_idx; diff --git a/modules/calib3d/src/usac/termination.cpp b/modules/calib3d/src/usac/termination.cpp index 803b060e4159246000693deee2763e4d08694d1b..26a9e331ed969a4c5867645918a168446085abe1 100644 --- a/modules/calib3d/src/usac/termination.cpp +++ b/modules/calib3d/src/usac/termination.cpp @@ -19,7 +19,7 @@ public: /* * Get upper bound iterations for any sample number - * n is points size, w is inlier ratio, p is desired probability, k is expceted number of iterations. + * n is points size, w is inlier ratio, p is desired probability, k is expected number of iterations. * 1 - p = (1 - w^n)^k, * k = log_(1-w^n) (1-p) * k = ln (1-p) / ln (1-w^n) diff --git a/modules/calib3d/src/usac/utils.cpp b/modules/calib3d/src/usac/utils.cpp index 5e2206702fe8fb6afd6c9e9f27d02222a628bad1..da1956f26c2f8c10038434fbe8ebd6973ea13a0f 100644 --- a/modules/calib3d/src/usac/utils.cpp +++ b/modules/calib3d/src/usac/utils.cpp @@ -344,10 +344,10 @@ void Utils::decomposeProjection (const Mat &P, Matx33d &K, Matx33d &R, Vec3d &t, } double Utils::getPoissonCDF (double lambda, int inliers) { - double exp_lamda = exp(-lambda), cdf = exp_lamda, lambda_i_div_fact_i = 1; + double exp_lambda = exp(-lambda), cdf = exp_lambda, lambda_i_div_fact_i = 1; for (int i = 1; i <= inliers; i++) { lambda_i_div_fact_i *= (lambda / i); - cdf += exp_lamda * lambda_i_div_fact_i; + cdf += exp_lambda * lambda_i_div_fact_i; if (fabs(cdf - 1) < DBL_EPSILON) // cdf is almost 1 break; }