From e46810eabe266f9d050e9a4e0182be298c1ba762 Mon Sep 17 00:00:00 2001 From: Adrien BAK Date: Thu, 2 Oct 2014 15:24:24 +0900 Subject: [PATCH] this has been submitted to the daily wtf --- modules/photo/src/seamless_cloning_impl.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/photo/src/seamless_cloning_impl.cpp b/modules/photo/src/seamless_cloning_impl.cpp index e130f841a1..e2cfb64f82 100644 --- a/modules/photo/src/seamless_cloning_impl.cpp +++ b/modules/photo/src/seamless_cloning_impl.cpp @@ -93,6 +93,9 @@ void Cloning::dst(const std::vector& mod_diff, std::vector& sine Mat result; int p=0; + + const double factor = 0.5; + for(int i=0;i(0,0) = 0.0; @@ -119,13 +122,9 @@ void Cloning::dst(const std::vector& mod_diff, std::vector& sine split(result, planes1); - std::complex two_i = std::sqrt(std::complex(-1)); - - double factor = -2*imag(two_i); - for(int c=1,z=0;c(z,0) = (float) (planes1[1].at(c,0)/factor); + res.at(z,0) = (float) (planes1[1].at(c,0) * factor); } for(int q=0,z=0;q