Merge pull request #22959 from feuerste:parallel_mertens
Parallelize implementation of HDR MergeMertens. * Parallelize MergeMertens. * Added performance tests for HDR. * Ran clang-format. * Optimizations. * Fix data path for Windows. * Remove compiiation warning on Windows. * Remove clang-format for existing file. * Addressing reviewer comments. * Ensure correct summation order. * Add test for determinism. * Move result pyramid into sync struct. * Reuse sync for first loop as well. * Use OpenCV's threading primitives. * Remove cout.
This commit is contained in:
@@ -107,12 +107,19 @@ class UMat(NewOpenCVTests):
|
||||
|
||||
images, _ = load_exposure_seq(os.path.join(test_data_path, 'exposures'))
|
||||
|
||||
# As we want to test mat vs. umat here, we temporarily set only one worker-thread to achieve
|
||||
# deterministic summations inside mertens' parallelized process.
|
||||
num_threads = cv.getNumThreads()
|
||||
cv.setNumThreads(1)
|
||||
|
||||
merge = cv.createMergeMertens()
|
||||
mat_result = merge.process(images)
|
||||
|
||||
umat_images = [cv.UMat(img) for img in images]
|
||||
umat_result = merge.process(umat_images)
|
||||
|
||||
cv.setNumThreads(num_threads)
|
||||
|
||||
self.assertTrue(np.allclose(umat_result.get(), mat_result))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user