1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge pull request #26590 from Kumataro:fix26589

Support C++20 standard #26590

Close https://github.com/opencv/opencv/issues/26589
Related https://github.com/opencv/opencv_contrib/pull/3842
Related: https://github.com/opencv/opencv/issues/20269

- do not arithmetic enums and ( different enums or floating numeric) 
- remove unused variable

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [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
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
Kumataro
2024-12-17 13:40:27 +09:00
committed by GitHub
parent 1a1b1901e8
commit 260f511dfb
27 changed files with 143 additions and 178 deletions
+11 -11
View File
@@ -282,7 +282,7 @@ void CV_ResizeTest::prepare_to_validation( int /*test_case_idx*/ )
int elem_size = CV_ELEM_SIZE(src->type);
int drows = dst->rows, dcols = dst->cols;
if( interpolation == CV_INTER_NN )
if( interpolation == cv::INTER_NEAREST )
{
for( j = 0; j < dcols; j++ )
{
@@ -373,7 +373,7 @@ void CV_ResizeExactTest::get_test_array_types_and_sizes(int test_case_idx, vecto
/////////////////////////
static void test_remap( const Mat& src, Mat& dst, const Mat& mapx, const Mat& mapy,
Mat* mask=0, int interpolation=CV_INTER_LINEAR )
Mat* mask=0, int interpolation=cv::INTER_LINEAR )
{
int x, y, k;
int drows = dst.rows, dcols = dst.cols;
@@ -384,7 +384,7 @@ static void test_remap( const Mat& src, Mat& dst, const Mat& mapx, const Mat& ma
int step = (int)(src.step / CV_ELEM_SIZE(depth));
int delta;
if( interpolation != CV_INTER_CUBIC )
if( interpolation != cv::INTER_CUBIC )
{
delta = 0;
scols -= 1; srows -= 1;
@@ -762,7 +762,7 @@ void CV_RemapTest::get_test_array_types_and_sizes( int test_case_idx, vector<vec
{
CV_ImgWarpBaseTest::get_test_array_types_and_sizes( test_case_idx, sizes, types );
types[INPUT][1] = types[INPUT][2] = CV_32FC1;
interpolation = CV_INTER_LINEAR;
interpolation = cv::INTER_LINEAR;
}
@@ -917,7 +917,7 @@ void CV_GetRectSubPixTest::get_test_array_types_and_sizes( int test_case_idx, ve
center.x = (float)(cvtest::randReal(rng)*src_size.width);
center.y = (float)(cvtest::randReal(rng)*src_size.height);
interpolation = CV_INTER_LINEAR;
interpolation = cv::INTER_LINEAR;
test_cpp = (cvtest::randInt(rng) & 256) == 0;
}
@@ -1595,7 +1595,7 @@ TEST(Imgproc_Remap, DISABLED_memleak)
putchar('.');
fflush(stdout);
}
remap(src, dst, map_x, map_y, CV_INTER_LINEAR);
remap(src, dst, map_x, map_y, cv::INTER_LINEAR);
}
}
@@ -1617,11 +1617,11 @@ TEST(Imgproc_linearPolar, identity)
{
linearPolar(src, dst,
Point2f((N-1) * 0.5f, (N-1) * 0.5f), N * 0.5f,
cv::WARP_FILL_OUTLIERS | CV_INTER_LINEAR | cv::WARP_INVERSE_MAP);
cv::WARP_FILL_OUTLIERS | cv::INTER_LINEAR | cv::WARP_INVERSE_MAP);
linearPolar(dst, src,
Point2f((N-1) * 0.5f, (N-1) * 0.5f), N * 0.5f,
cv::WARP_FILL_OUTLIERS | CV_INTER_LINEAR);
cv::WARP_FILL_OUTLIERS | cv::INTER_LINEAR);
double psnr = cvtest::PSNR(in(roi), src(roi));
EXPECT_LE(25, psnr) << "iteration=" << i;
@@ -1658,11 +1658,11 @@ TEST(Imgproc_logPolar, identity)
{
logPolar(src, dst,
Point2f((N-1) * 0.5f, (N-1) * 0.5f), M,
cv::WARP_FILL_OUTLIERS | CV_INTER_LINEAR | cv::WARP_INVERSE_MAP);
cv::WARP_FILL_OUTLIERS | cv::INTER_LINEAR | cv::WARP_INVERSE_MAP);
logPolar(dst, src,
Point2f((N-1) * 0.5f, (N-1) * 0.5f), M,
cv::WARP_FILL_OUTLIERS | CV_INTER_LINEAR);
cv::WARP_FILL_OUTLIERS | cv::INTER_LINEAR);
double psnr = cvtest::PSNR(in(roi), src(roi));
EXPECT_LE(25, psnr) << "iteration=" << i;
@@ -1694,7 +1694,7 @@ TEST(Imgproc_warpPolar, identity)
Rect roi = Rect(0, 0, in.cols - ((N + 19) / 20), in.rows);
Point2f center = Point2f((N - 1) * 0.5f, (N - 1) * 0.5f);
double radius = N * 0.5;
int flags = cv::WARP_FILL_OUTLIERS | CV_INTER_LINEAR;
int flags = cv::WARP_FILL_OUTLIERS | cv::INTER_LINEAR;
// test linearPolar
for (int ki = 1; ki <= 5; ki++)
{