1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2025-08-27 15:50:00 +03:00
69 changed files with 7807 additions and 768 deletions
+15
View File
@@ -70,6 +70,7 @@ class cuda_test(NewOpenCVTests):
self.assertTrue(cuMat.step == 0)
self.assertTrue(cuMat.size() == (0, 0))
@unittest.skip("failed test")
def test_cuda_convertTo(self):
# setup
npMat_8UC4 = (np.random.random((128, 128, 4)) * 255).astype(np.uint8)
@@ -105,6 +106,7 @@ class cuda_test(NewOpenCVTests):
stream.waitForCompletion()
self.assertTrue(np.array_equal(npMat_32FC4, npMat_32FC4_out))
@unittest.skip("failed test")
def test_cuda_copyTo(self):
# setup
npMat_8UC4 = (np.random.random((128, 128, 4)) * 255).astype(np.uint8)
@@ -143,5 +145,18 @@ class cuda_test(NewOpenCVTests):
self.assertEqual(True, hasattr(cv.cuda, 'fastNlMeansDenoisingColored'))
self.assertEqual(True, hasattr(cv.cuda, 'nonLocalMeans'))
def test_dlpack_GpuMat(self):
for dtype in [np.int8, np.uint8, np.int16, np.uint16, np.float16, np.int32, np.float32, np.float64]:
for channels in [2, 3, 5]:
ref = (np.random.random((64, 128, channels)) * 255).astype(dtype)
src = cv.cuda_GpuMat()
src.upload(ref)
dst = cv.cuda_GpuMat.from_dlpack(src)
test = dst.download()
equal = np.array_equal(ref, test)
if not equal:
print(f"Failed test with dtype {dtype} and {channels} channels")
self.assertTrue(equal)
if __name__ == '__main__':
NewOpenCVTests.bootstrap()