本文整理汇总了C++中FloatImage::MaxVal方法的典型用法代码示例。如果您正苦于以下问题:C++ FloatImage::MaxVal方法的具体用法?C++ FloatImage::MaxVal怎么用?C++ FloatImage::MaxVal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FloatImage
的用法示例。
在下文中一共展示了FloatImage::MaxVal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: depthFilter
void EpochModel::depthFilter(FloatImage &depthImgf, FloatImage &countImgf, float depthJumpThr,
bool dilation, int dilationNumPasses, int dilationWinsize,
bool erosion, int erosionNumPasses, int erosionWinsize)
{
FloatImage depth;
FloatImage depth2;
int w = depthImgf.w;
int h = depthImgf.h;
depth=depthImgf;
if (dilation)
{
for (int k = 0; k < dilationNumPasses; k++)
{
depth.Dilate(depth2, dilationWinsize / 2);
depth=depth2;
}
}
if (erosion)
{
for (int k = 0; k < erosionNumPasses; k++)
{
depth.Erode(depth2, erosionWinsize / 2);
depth=depth2;
}
}
Histogramf HH;
HH.Clear();
HH.SetRange(0,depthImgf.MaxVal()-depthImgf.MinVal(),10000);
for(int i=1; i < static_cast<int>(depthImgf.v.size()); ++i)
HH.Add(fabs(depthImgf.v[i]-depth.v[i-1]));
if(logFP) fprintf(logFP,"**** Depth histogram 2 Min %f Max %f Avg %f Percentiles ((10)%f (25)%f (50)%f (75)%f (90)%f)\n",HH.MinV(),HH.MaxV(),HH.Avg(),
HH.Percentile(.1),HH.Percentile(.25),HH.Percentile(.5),HH.Percentile(.75),HH.Percentile(.9));
int deletedCnt=0;
depthJumpThr = static_cast<float>(HH.Percentile(0.8));
for (int y = 0; y < h; y++)
for (int x = 0; x < w; x++)
{
if ((depthImgf.Val(x, y) - depth.Val(x, y)) / depthImgf.Val(x, y) > 0.6)
{
countImgf.Val(x, y) = 0.0f;
++deletedCnt;
}
}
countImgf.convertToQImage().save("tmp_filteredcount.jpg","jpg");
if(logFP) fprintf(logFP,"**** depthFilter: deleted %i on %i\n",deletedCnt,w*h);
}
示例2:
float Arc3DModel::ComputeDepthJumpThr(FloatImage &depthImgf, float percentile)
{
Histogramf HH;
HH.Clear();
HH.SetRange(0,depthImgf.MaxVal()-depthImgf.MinVal(),10000);
for(unsigned int i=1; i < static_cast<unsigned int>(depthImgf.v.size()); ++i)
HH.Add(fabs(depthImgf.v[i]-depthImgf.v[i-1]));
return HH.Percentile(percentile);
}
示例3: ComputeDepthJumpThr
float EpochModel::ComputeDepthJumpThr(FloatImage &depthImgf, float percentile)
{
Histogramf HH;
HH.Clear();
HH.SetRange(0,depthImgf.MaxVal()-depthImgf.MinVal(),10000);
for(unsigned int i=1; i < static_cast<unsigned int>(depthImgf.v.size()); ++i)
HH.Add(fabs(depthImgf.v[i]-depthImgf.v[i-1]));
if(logFP) fprintf(logFP,"**** Depth histogram Min %f Max %f Avg %f Percentiles ((10)%f (25)%f (50)%f (75)%f (90)%f)\n",HH.MinV(),HH.MaxV(),HH.Avg(),
HH.Percentile(.1),HH.Percentile(.25),HH.Percentile(.5),HH.Percentile(.75),HH.Percentile(.9));
return HH.Percentile(percentile);
}