本文整理汇总了C++中Mat::ATF方法的典型用法代码示例。如果您正苦于以下问题:C++ Mat::ATF方法的具体用法?C++ Mat::ATF怎么用?C++ Mat::ATF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mat
的用法示例。
在下文中一共展示了Mat::ATF方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getLaplacian
// Get the following Laplacian matrix
// 0 1 0
// 1 -4 1
// 0 1 0
Mat PoissonBlending::getLaplacian()
{
Mat lap = Mat::zeros(3, 3, CV_32FC1);
lap.ATF(0, 1) = 1.0;
lap.ATF(1, 0) = 1.0;
lap.ATF(1, 2) = 1.0;
lap.ATF(2, 1) = 1.0;
lap.ATF(1, 1) = -4.0;
return lap;
}
示例2: getA
// get Matrix A.
Mat PoissonBlending::getA(Mat &roiMask,vector<Point> &Points)
{
Mat A = Mat::eye(Points.size(), Points.size(), CV_32FC1);
A *= -4;
#pragma omp parallel for
for (int i = 0; i < A.rows; i++)
{
#pragma omp parallel for
for (int j = 0; j < A.cols; j++)
{
if (i == j)
A.ATF(i, j) = -4.0;
else if (isAdjacent(roiMask,Points, i, j))
{
A.ATF(i, j) = 1.0;
}
}
}
return A;
}
示例3: getGradient
// Calculate b
// using Gradients Mixing.
Mat PoissonBlending::getB3(Mat &src, Mat &dst, Mat &roiMask, vector<Point>&Points, Point loc, Rect ROI)
{
Mat gradMat = getGradient(src) + getGradient(dst);
int mh = roiMask.rows;
int mw = roiMask.cols;
Mat B = Mat::zeros(Points.size(), 1, CV_32FC1);
for (int i = 0; i < Points.size(); i++)
{
Point pt = Points[i];
double tmp = 0.0;
tmp = gradMat.ATF(ROI.y + pt.y, ROI.x + pt.x);
if (pt.y>0 && roiMask.ATU(pt.y - 1, pt.x) != 255)
tmp -= dst.ATF(pt.y + loc.y - 1, pt.x + loc.x);
if (pt.y + 1<mh && roiMask.ATU(pt.y + 1, pt.x) != 255)
tmp -= dst.ATF(pt.y + loc.y + 1, pt.x + loc.x);
if (pt.x + 1<mw && roiMask.ATU(pt.y, pt.x + 1) != 255)
tmp -= dst.ATF(pt.y + loc.y, pt.x + loc.x + 1);
if (pt.x>0 && roiMask.ATU(pt.y, pt.x - 1) != 255)
tmp -= dst.ATF(pt.y + loc.y, pt.x + loc.x - 1);
B.ATF(i, 0) = tmp;
}
return B;
}