Skip to content

Commit 009ff0a

Browse files
committed
Merge branch 4.x
2 parents d2ff903 + abaddbc commit 009ff0a

File tree

30 files changed

+872
-62
lines changed

30 files changed

+872
-62
lines changed

.github/workflows/PR-5.x.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
with:
1212
workflow_branch: main
1313

14-
Ubuntu2004-ARM64:
14+
Ubuntu2404-ARM64:
1515
uses: opencv/ci-gha-workflow/.github/workflows/OCV-Contrib-PR-5.x-ARM64.yaml@main
1616

17-
Ubuntu2004-ARM64-FastCV:
17+
Ubuntu2404-ARM64-FastCV:
1818
uses: opencv/ci-gha-workflow/.github/workflows/OCV-Contrib-PR-5.x-ARM64-FastCV.yaml@main
1919

2020
Ubuntu2004-x64-CUDA:

modules/bgsegm/include/opencv2/bgsegm.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class CV_EXPORTS_W BackgroundSubtractorGMG : public BackgroundSubtractor
147147
rate. 0 means that the background model is not updated at all, 1 means that the background model
148148
is completely reinitialized from the last frame.
149149
150-
@note This method has a default virtual implementation that throws a "not impemented" error.
150+
@note This method has a default virtual implementation that throws a "not implemented" error.
151151
Foreground masking may not be supported by all background subtractors.
152152
*/
153153
CV_WRAP virtual void apply(InputArray image, InputArray knownForegroundMask, OutputArray fgmask, double learningRate=-1) CV_OVERRIDE = 0;

modules/cudacodec/CMakeLists.txt

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,23 @@ if(WITH_NVCUVENC AND NOT HAVE_NVCUVENC)
3030
message(WARNING "cudacodec::VideoWriter requires Nvidia Video Codec SDK. Please resolve dependency or disable WITH_NVCUVENC=OFF")
3131
endif()
3232

33-
if(HAVE_NVCUVID OR HAVE_NVCUVENC)
34-
if(ENABLE_CUDA_FIRST_CLASS_LANGUAGE)
35-
list(APPEND extra_libs CUDA::cuda_driver CUDA::cudart${CUDA_LIB_EXT})
36-
else()
37-
list(APPEND extra_libs ${CUDA_CUDA_LIBRARY})
38-
endif()
39-
if(HAVE_NVCUVID)
40-
list(APPEND extra_libs ${CUDA_nvcuvid_LIBRARY})
41-
endif()
42-
if(HAVE_NVCUVENC)
43-
if(WIN32)
44-
list(APPEND extra_libs ${CUDA_nvencodeapi_LIBRARY})
45-
else()
46-
list(APPEND extra_libs ${CUDA_nvidia-encode_LIBRARY})
47-
endif()
48-
endif()
33+
if(ENABLE_CUDA_FIRST_CLASS_LANGUAGE)
34+
list(APPEND extra_libs CUDA::cuda_driver CUDA::cudart${CUDA_LIB_EXT})
35+
else()
36+
list(APPEND extra_libs ${CUDA_CUDA_LIBRARY})
37+
endif()
38+
if(HAVE_NVCUVID)
39+
list(APPEND extra_libs ${CUDA_nvcuvid_LIBRARY})
40+
endif()
41+
if(HAVE_NVCUVENC)
42+
if(WIN32)
43+
list(APPEND extra_libs ${CUDA_nvencodeapi_LIBRARY})
44+
else()
45+
list(APPEND extra_libs ${CUDA_nvidia-encode_LIBRARY})
46+
endif()
4947
endif()
5048

5149
ocv_create_module(${extra_libs})
5250

5351
ocv_add_accuracy_tests()
54-
ocv_add_perf_tests()
52+
ocv_add_perf_tests()

modules/cudaimgproc/src/cuda/corners.cu

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ namespace cv { namespace cuda { namespace device
154154
cudaSafeCall( cudaGetLastError() );
155155

156156
if (stream == 0)
157-
cudaSafeCall( cudaDeviceSynchronize() );
157+
cudaSafeCall(cudaDeviceSynchronize());
158+
else
159+
cudaSafeCall(cudaStreamSynchronize(stream));
158160
}
159161

160162
/////////////////////////////////////////// Corner Min Eigen Val /////////////////////////////////////////////////
@@ -262,6 +264,8 @@ namespace cv { namespace cuda { namespace device
262264

263265
if (stream == 0)
264266
cudaSafeCall(cudaDeviceSynchronize());
267+
else
268+
cudaSafeCall(cudaStreamSynchronize(stream));
265269
}
266270
}
267271
}}}

modules/cudawarping/perf/perf_warping.cpp

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,57 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Scale, Resize,
180180
}
181181
}
182182

183+
//////////////////////////////////////////////////////////////////////
184+
// ResizeLanczos
185+
186+
PERF_TEST_P(Sz_Depth_Cn_Inter_Scale, ResizeLanczos,
187+
Combine(CUDA_TYPICAL_MAT_SIZES,
188+
Values(CV_8U, CV_32F),
189+
CUDA_CHANNELS_1_3_4,
190+
Values(Interpolation(cv::INTER_LANCZOS4)),
191+
Values(0.5, 1.5, 2.0)))
192+
{
193+
declare.time(20.0);
194+
195+
const cv::Size size = GET_PARAM(0);
196+
const int depth = GET_PARAM(1);
197+
const int channels = GET_PARAM(2);
198+
const int interpolation = GET_PARAM(3);
199+
const double f = GET_PARAM(4);
200+
201+
const int type = CV_MAKE_TYPE(depth, channels);
202+
203+
cv::Mat src(size, type);
204+
declare.in(src, WARMUP_RNG);
205+
206+
if (PERF_RUN_CUDA())
207+
{
208+
const cv::cuda::GpuMat d_src(src);
209+
cv::cuda::GpuMat dst;
210+
cv::Size dsize(cv::saturate_cast<int>(src.cols * f), cv::saturate_cast<int>(src.rows * f));
211+
cv::Mat host_dst(dsize, type);
212+
213+
declare.out(host_dst);
214+
215+
TEST_CYCLE() cv::cuda::resize(d_src, dst, cv::Size(), f, f, interpolation);
216+
217+
dst.download(host_dst);
218+
219+
CUDA_SANITY_CHECK(dst, 1e-3, ERROR_RELATIVE);
220+
}
221+
else
222+
{
223+
cv::Size dsize(cv::saturate_cast<int>(src.cols * f), cv::saturate_cast<int>(src.rows * f));
224+
cv::Mat dst(dsize, type);
225+
226+
declare.out(dst);
227+
228+
TEST_CYCLE() cv::resize(src, dst, cv::Size(), f, f, interpolation);
229+
230+
CPU_SANITY_CHECK(dst);
231+
}
232+
}
233+
183234
//////////////////////////////////////////////////////////////////////
184235
// ResizeArea
185236

0 commit comments

Comments
 (0)