From b774753922dd4cc58eb9c710ec5ed950bd2005ae Mon Sep 17 00:00:00 2001 From: Vincent Rabaud Date: Wed, 21 Dec 2022 18:28:26 +0100 Subject: [PATCH] Fix self converTo. We still need images[i] = img because it is used below in buildPyramid. --- modules/photo/src/merge.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/photo/src/merge.cpp b/modules/photo/src/merge.cpp index b0a36d4f6f..18050574ab 100644 --- a/modules/photo/src/merge.cpp +++ b/modules/photo/src/merge.cpp @@ -176,16 +176,16 @@ public: parallel_for_(Range(0, static_cast(images.size())), [&](const Range& range) { for(int i = range.start; i < range.end; i++) { - Mat& img = images[i]; - Mat gray, contrast, saturation, wellexp; + Mat img, gray, contrast, saturation, wellexp; std::vector splitted(channels); - img.convertTo(img, CV_32F, 1.0f/255.0f); + images[i].convertTo(img, CV_32F, 1.0f/255.0f); if(channels == 3) { cvtColor(img, gray, COLOR_RGB2GRAY); } else { img.copyTo(gray); } + images[i] = img; split(img, splitted); Laplacian(gray, contrast, CV_32F);