本文整理汇总了C++中Point2f::ptr方法的典型用法代码示例。如果您正苦于以下问题:C++ Point2f::ptr方法的具体用法?C++ Point2f::ptr怎么用?C++ Point2f::ptr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point2f
的用法示例。
在下文中一共展示了Point2f::ptr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ScorePixel
// compute pixel's NCC score
float DepthEstimator::ScorePixel(Depth depth, const Normal& normal)
{
ASSERT(normal.z < 0);
FOREACH(idx, images) {
// center a patch of given size on the segment and fetch the pixel values in the target image
const ViewData& image1 = images[idx];
float& score = scores[idx];
const Matrix3x3f H(ComputeHomographyMatrix(image1, depth, normal));
Point2f pt;
int n = 0;
for (int i=0; i<nSizeWindow; ++i) {
for (int j=0; j<nSizeWindow; ++j) {
ProjectVertex_3x3_2_2(H.val, Point2f((float)(lt0.x+j), (float)(lt0.y+i)).ptr(), pt.ptr());
if (!image1.view.image.isInsideWithBorder<float,1>(pt)) {
score = 2.f;
goto NEXT_IMAGE;
}
texels1(n++) = image1.view.image.sample(pt);
}
}
{
ASSERT(n == nTexels);
// score similarity of the reference and target texture patches
const float normSq1(normSqZeroMean<float,float,nTexels>(texels1.data()));
const float nrm(normSq0*normSq1);
if (nrm == 0.f) {
score = 1.f;
continue;
}
const float ncc(texels0.dot(texels1)/SQRT(nrm));
score = 1.f - CLAMP(ncc, -1.f, 1.f);
// encourage smoothness
FOREACHPTR(pNbr, neighborsData) {
score *= 1.f - (1.f - smoothBonusDepth) * EXP(SQUARE(DepthSimilarity(depth, pNbr->depth)) * smoothSigmaDepth);
score *= 1.f - (1.f - smoothBonusNormal) * EXP(SQUARE(ACOS(ComputeAngle<float,float>(normal.ptr(), pNbr->normal.ptr()))) * smoothSigmaNormal);
}
}
NEXT_IMAGE:;
}