From df312a4ffaa5417baa2fbdf55b6458e1e2ba84ed Mon Sep 17 00:00:00 2001 From: Adrien BAK Date: Thu, 9 Oct 2014 16:35:30 +0900 Subject: [PATCH] at<> -> ptr<> --- modules/photo/src/seamless_cloning_impl.cpp | 28 ++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/photo/src/seamless_cloning_impl.cpp b/modules/photo/src/seamless_cloning_impl.cpp index 9a69800a84..509ce476d6 100644 --- a/modules/photo/src/seamless_cloning_impl.cpp +++ b/modules/photo/src/seamless_cloning_impl.cpp @@ -204,8 +204,8 @@ void Cloning::poissonSolver(const Mat &img, Mat &laplacianX , Mat &laplacianY, M for(int j=1;j(i,j) + (int)bound.at(i,(j+1)) + (int)bound.at(i,(j-1)) - + (int)bound.at(i-1,j) + (int)bound.at(i+1,j); + boundary_point[idx] = -4*(int)bound.ptr(i)[j] + (int)bound.ptr(i)[j+1] + (int)bound.ptr(i)[j-1] + + (int)bound.ptr(i-1)[j] + (int)bound.ptr(i+1)[j]; } Mat diff = Mat(h,w,CV_32FC1); @@ -214,7 +214,7 @@ void Cloning::poissonSolver(const Mat &img, Mat &laplacianX , Mat &laplacianY, M for(int j=0;j(i,j) = (float) (lap.at(i,j) - boundary_point[idx]); + diff.ptr(i)[j] = (lap.ptr(i)[j] - boundary_point[idx]); } } @@ -224,7 +224,7 @@ void Cloning::poissonSolver(const Mat &img, Mat &laplacianX , Mat &laplacianY, M for(int j = 0 ; j < w-2; j++) { idx = i*(w-2) + j; - mod_diff[idx] = diff.at(i+1,j+1); + mod_diff[idx] = diff.ptr(i+1)[j+1]; } } @@ -355,21 +355,21 @@ void Cloning::normalClone(const Mat &destination, const Mat &patch, const Mat &b { for(int c=0;c(i,j*channel+c) - patchGradientY.at(i,j*channel+c)) > - abs(destinationGradientX.at(i,j*channel+c) - destinationGradientY.at(i,j*channel+c))) + if(abs(patchGradientX.ptr(i)[j*channel+c] - patchGradientY.ptr(i)[j*channel+c]) > + abs(destinationGradientX.ptr(i)[j*channel+c] - destinationGradientY.ptr(i)[j*channel+c])) { - patchGradientX.at(i,j*channel+c) = patchGradientX.at(i,j*channel+c) - * binaryMaskFloat.at(i,j); - patchGradientY.at(i,j*channel+c) = patchGradientY.at(i,j*channel+c) - * binaryMaskFloat.at(i,j); + patchGradientX.ptr(i)[j*channel+c] = patchGradientX.ptr(i)[j*channel+c] + * binaryMaskFloat.ptr(i)[j]; + patchGradientY.ptr(i)[j*channel+c] = patchGradientY.ptr(i)[j*channel+c] + * binaryMaskFloat.ptr(i)[j]; } else { - patchGradientX.at(i,j*channel+c) = destinationGradientX.at(i,j*channel+c) - * binaryMaskFloat.at(i,j); - patchGradientY.at(i,j*channel+c) = destinationGradientY.at(i,j*channel+c) - * binaryMaskFloat.at(i,j); + patchGradientX.ptr(i)[j*channel+c] = destinationGradientX.ptr(i)[j*channel+c] + * binaryMaskFloat.ptr(i)[j]; + patchGradientY.ptr(i)[j*channel+c] = destinationGradientY.ptr(i)[j*channel+c] + * binaryMaskFloat.ptr(i)[j]; } } }