...
 
Commits (9)
    https://gitcode.net/greenplum/opencv/-/commit/d17507052ef4973ca56df7d56946d6ad8c69cb4b Rewrite SIMD code by using new Universal Intrinsic API. 2023-06-28T17:12:37+08:00 Liutong HAN liutong2020@iscas.ac.cn https://gitcode.net/greenplum/opencv/-/commit/bca5868817ee9ffdf8ad3f79ae40cb6a0d2ff239 removing duplicated statement 2023-07-01T13:29:02+08:00 Wang Kai wongkai@hnu.edu.cn https://gitcode.net/greenplum/opencv/-/commit/50fc68b9818c7acf3eca44e4676c1d8e4a8c8c46 Update PRs & Issue templates to exclude 3.4 from active development. 2023-07-03T11:00:30+03:00 Alexander Smorkalov alexander.smorkalov@xperience.ai https://gitcode.net/greenplum/opencv/-/commit/64be9c8bf670f1bb39c7e5e6282f8e569b38df5b Merge pull request #23901 from kai-waang:remove-duplicated 2023-07-03T11:26:36+03:00 Alexander Smorkalov 2536374+asmorkalov@users.noreply.github.com removing duplicated statement https://gitcode.net/greenplum/opencv/-/commit/e9414169a3824d075ad4939c11a97402ffc5cef1 Fix compilation when HAVE_QUIRC is not set. 2023-07-03T11:35:05+03:00 Vincent Rabaud vrabaud@google.com One variable is unknown while the other one is unused. Fixed build warnings. https://gitcode.net/greenplum/opencv/-/commit/0661aff4a50ff46c1f437dc3cebbe38145ed351c Merge pull request #23900 from kai-waang:fixing-typo 2023-07-03T12:08:12+03:00 Wang Kai 53281385+kai-waang@users.noreply.github.com Fixing typos in usac #23900 Just read and correct some typos in `usac` ### Pull Request Readiness Checklist See details at <a href="https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request" rel="nofollow noreferrer noopener" target="_blank">https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request</a> - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake https://gitcode.net/greenplum/opencv/-/commit/aea44efaa627d1154435dce1ca36498e6a902ef5 Merge pull request #23909 from asmorkalov:as/exclude_3.4 2023-07-03T12:27:11+03:00 Alexander Smorkalov 2536374+asmorkalov@users.noreply.github.com Update PRs &amp; Issue templates to exclude 3.4 from active development https://gitcode.net/greenplum/opencv/-/commit/377be68d923e40900ac5526242bcf221e3f355e5 Merge pull request #23892 from vrabaud:compile_fix 2023-07-03T13:16:49+03:00 Alexander Smorkalov 2536374+asmorkalov@users.noreply.github.com Fix compilation when HAVE_QUIRC is not set. https://gitcode.net/greenplum/opencv/-/commit/67faf1610e665ea36b3f80c7fd6f9a68a0559900 Merge pull request #23885 from hanliutong:UniversalIntrinsicRewriter 2023-07-03T14:56:30+00:00 Alexander Alekhin alexander.a.alekhin@gmail.com
......@@ -15,12 +15,12 @@ body:
Please provide the following system information to help us diagnose the bug. For example:
// example for c++ user
OpenCV version: 4.6.0
OpenCV version: 4.8.0
Operating System / Platform: Ubuntu 20.04
Compiler & compiler version: GCC 9.3.0
// example for python user
OpenCV python version: 4.6.0.66
OpenCV python version: 4.8.0.74
Operating System / Platform: Ubuntu 20.04
Python version: 3.9.6
validations:
......
......@@ -12,7 +12,7 @@ body:
attributes:
label: Describe the doc issue
description: >
Please provide a clear and concise description of what content in https://docs.opencv.org/ is an issue. Note that there are multiple active branches, such as 3.4, 4.x and 5.x, so please specify the branch with the problem.
Please provide a clear and concise description of what content in https://docs.opencv.org/ is an issue. Note that there are multiple active branches, such as 4.x and 5.x, so please specify the branch with the problem.
placeholder: |
A clear and concise description of what content in https://docs.opencv.org/ is an issue.
......
......@@ -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|
......
......@@ -142,7 +142,7 @@ public:
}
std::vector<double> 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]);
......
......@@ -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<int> sample(points_size);
for (int i = 0; i < points_size; i++) sample[i] = i;
const Ptr<NormTransform> 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);
......
......@@ -13,7 +13,6 @@ class GammaValuesImpl : public GammaValues {
int max_size_table, DoF;
public:
GammaValuesImpl (int DoF_, int max_size_table_) {
max_size_table = max_size_table_;
max_size_table = max_size_table_;
DoF = DoF_;
/*
......
......@@ -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];
......
......@@ -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;
......
......@@ -62,8 +62,8 @@ Ptr<UniformSampler> 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<UniformRandomGenerator> 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;
......
......@@ -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)
......
......@@ -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;
}
......
......@@ -24,7 +24,7 @@ struct SumSqr_SIMD
}
};
#if CV_SIMD
#if CV_SIMD || CV_SIMD_SCALABLE
template <>
struct SumSqr_SIMD<uchar, int, int>
......@@ -39,37 +39,37 @@ struct SumSqr_SIMD<uchar, int, int>
v_int32 v_sum = vx_setzero_s32();
v_int32 v_sqsum = vx_setzero_s32();
const int len0 = len & -v_uint8::nlanes;
const int len0 = len & -VTraits<v_uint8>::vlanes();
while(x < len0)
{
const int len_tmp = min(x + 256*v_uint16::nlanes, len0);
const int len_tmp = min(x + 256*VTraits<v_uint16>::vlanes(), len0);
v_uint16 v_sum16 = vx_setzero_u16();
for ( ; x < len_tmp; x += v_uint8::nlanes)
for ( ; x < len_tmp; x += VTraits<v_uint8>::vlanes())
{
v_uint16 v_src0 = vx_load_expand(src0 + x);
v_uint16 v_src1 = vx_load_expand(src0 + x + v_uint16::nlanes);
v_sum16 += v_src0 + v_src1;
v_uint16 v_src1 = vx_load_expand(src0 + x + VTraits<v_uint16>::vlanes());
v_sum16 = v_add(v_sum16, v_add(v_src0, v_src1));
v_int16 v_tmp0, v_tmp1;
v_zip(v_reinterpret_as_s16(v_src0), v_reinterpret_as_s16(v_src1), v_tmp0, v_tmp1);
v_sqsum += v_dotprod(v_tmp0, v_tmp0) + v_dotprod(v_tmp1, v_tmp1);
v_sqsum = v_add(v_sqsum, v_add(v_dotprod(v_tmp0, v_tmp0), v_dotprod(v_tmp1, v_tmp1)));
}
v_uint32 v_half0, v_half1;
v_expand(v_sum16, v_half0, v_half1);
v_sum += v_reinterpret_as_s32(v_half0 + v_half1);
v_sum = v_add(v_sum, v_reinterpret_as_s32(v_add(v_half0, v_half1)));
}
if (x <= len - v_uint16::nlanes)
if (x <= len - VTraits<v_uint16>::vlanes())
{
v_uint16 v_src = vx_load_expand(src0 + x);
v_uint16 v_half = v_combine_high(v_src, v_src);
v_uint32 v_tmp0, v_tmp1;
v_expand(v_src + v_half, v_tmp0, v_tmp1);
v_sum += v_reinterpret_as_s32(v_tmp0);
v_expand(v_add(v_src, v_half), v_tmp0, v_tmp1);
v_sum = v_add(v_sum, v_reinterpret_as_s32(v_tmp0));
v_int16 v_tmp2, v_tmp3;
v_zip(v_reinterpret_as_s16(v_src), v_reinterpret_as_s16(v_half), v_tmp2, v_tmp3);
v_sqsum += v_dotprod(v_tmp2, v_tmp2);
x += v_uint16::nlanes;
v_sqsum = v_add(v_sqsum, v_dotprod(v_tmp2, v_tmp2));
x += VTraits<v_uint16>::vlanes();
}
if (cn == 1)
......@@ -79,13 +79,13 @@ struct SumSqr_SIMD<uchar, int, int>
}
else
{
int CV_DECL_ALIGNED(CV_SIMD_WIDTH) ar[2 * v_int32::nlanes];
int CV_DECL_ALIGNED(CV_SIMD_WIDTH) ar[2 * VTraits<v_int32>::max_nlanes];
v_store(ar, v_sum);
v_store(ar + v_int32::nlanes, v_sqsum);
for (int i = 0; i < v_int32::nlanes; ++i)
v_store(ar + VTraits<v_int32>::vlanes(), v_sqsum);
for (int i = 0; i < VTraits<v_int32>::vlanes(); ++i)
{
sum[i % cn] += ar[i];
sqsum[i % cn] += ar[v_int32::nlanes + i];
sqsum[i % cn] += ar[VTraits<v_int32>::vlanes() + i];
}
}
v_cleanup();
......@@ -106,37 +106,37 @@ struct SumSqr_SIMD<schar, int, int>
v_int32 v_sum = vx_setzero_s32();
v_int32 v_sqsum = vx_setzero_s32();
const int len0 = len & -v_int8::nlanes;
const int len0 = len & -VTraits<v_int8>::vlanes();
while (x < len0)
{
const int len_tmp = min(x + 256 * v_int16::nlanes, len0);
const int len_tmp = min(x + 256 * VTraits<v_int16>::vlanes(), len0);
v_int16 v_sum16 = vx_setzero_s16();
for (; x < len_tmp; x += v_int8::nlanes)
for (; x < len_tmp; x += VTraits<v_int8>::vlanes())
{
v_int16 v_src0 = vx_load_expand(src0 + x);
v_int16 v_src1 = vx_load_expand(src0 + x + v_int16::nlanes);
v_sum16 += v_src0 + v_src1;
v_int16 v_src1 = vx_load_expand(src0 + x + VTraits<v_int16>::vlanes());
v_sum16 = v_add(v_sum16, v_add(v_src0, v_src1));
v_int16 v_tmp0, v_tmp1;
v_zip(v_src0, v_src1, v_tmp0, v_tmp1);
v_sqsum += v_dotprod(v_tmp0, v_tmp0) + v_dotprod(v_tmp1, v_tmp1);
v_sqsum = v_add(v_sqsum, v_add(v_dotprod(v_tmp0, v_tmp0), v_dotprod(v_tmp1, v_tmp1)));
}
v_int32 v_half0, v_half1;
v_expand(v_sum16, v_half0, v_half1);
v_sum += v_half0 + v_half1;
v_sum = v_add(v_sum, v_add(v_half0, v_half1));
}
if (x <= len - v_int16::nlanes)
if (x <= len - VTraits<v_int16>::vlanes())
{
v_int16 v_src = vx_load_expand(src0 + x);
v_int16 v_half = v_combine_high(v_src, v_src);
v_int32 v_tmp0, v_tmp1;
v_expand(v_src + v_half, v_tmp0, v_tmp1);
v_sum += v_tmp0;
v_expand(v_add(v_src, v_half), v_tmp0, v_tmp1);
v_sum = v_add(v_sum, v_tmp0);
v_int16 v_tmp2, v_tmp3;
v_zip(v_src, v_half, v_tmp2, v_tmp3);
v_sqsum += v_dotprod(v_tmp2, v_tmp2);
x += v_int16::nlanes;
v_sqsum = v_add(v_sqsum, v_dotprod(v_tmp2, v_tmp2));
x += VTraits<v_int16>::vlanes();
}
if (cn == 1)
......@@ -146,13 +146,13 @@ struct SumSqr_SIMD<schar, int, int>
}
else
{
int CV_DECL_ALIGNED(CV_SIMD_WIDTH) ar[2 * v_int32::nlanes];
int CV_DECL_ALIGNED(CV_SIMD_WIDTH) ar[2 * VTraits<v_int32>::max_nlanes];
v_store(ar, v_sum);
v_store(ar + v_int32::nlanes, v_sqsum);
for (int i = 0; i < v_int32::nlanes; ++i)
v_store(ar + VTraits<v_int32>::vlanes(), v_sqsum);
for (int i = 0; i < VTraits<v_int32>::vlanes(); ++i)
{
sum[i % cn] += ar[i];
sqsum[i % cn] += ar[v_int32::nlanes + i];
sqsum[i % cn] += ar[VTraits<v_int32>::vlanes() + i];
}
}
v_cleanup();
......
......@@ -10,6 +10,9 @@ void check_qr(const string& root, const string& name_current_image, const string
const std::vector<Point>& corners,
const std::vector<string>& decoded_info, const int max_pixel_error,
bool isMulti = false) {
#ifndef HAVE_QUIRC
CV_UNUSED(decoded_info);
#endif
const std::string dataset_config = findDataFile(root + "dataset_config.json");
FileStorage file_config(dataset_config, FileStorage::READ);
ASSERT_TRUE(file_config.isOpened()) << "Can't read validation data: " << dataset_config;
......
......@@ -374,8 +374,8 @@ TEST_P(Objdetect_QRCode_Multi, regression)
qrcode = QRCodeDetectorAruco();
}
std::vector<Point> corners;
#ifdef HAVE_QUIRC
std::vector<cv::String> decoded_info;
#ifdef HAVE_QUIRC
std::vector<Mat> straight_barcode;
EXPECT_TRUE(qrcode.detectAndDecodeMulti(src, decoded_info, corners, straight_barcode));
ASSERT_FALSE(corners.empty());
......@@ -538,7 +538,6 @@ TEST(Objdetect_QRCode_detect_flipped, regression_23249)
for(const auto &flipped_image : flipped_images){
const std::string &image_name = flipped_image.first;
const std::string &expect_msg = flipped_image.second;
std::string image_path = findDataFile(root + image_name);
Mat src = imread(image_path);
......@@ -551,6 +550,7 @@ TEST(Objdetect_QRCode_detect_flipped, regression_23249)
EXPECT_TRUE(!corners.empty());
std::string decoded_msg;
#ifdef HAVE_QUIRC
const std::string &expect_msg = flipped_image.second;
EXPECT_NO_THROW(decoded_msg = qrcode.decode(src, corners, straight_barcode));
ASSERT_FALSE(straight_barcode.empty()) << "Can't decode qrimage.";
EXPECT_EQ(expect_msg, decoded_msg);
......