本文整理汇总了C++中ImageSet::Allocator方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageSet::Allocator方法的具体用法?C++ ImageSet::Allocator怎么用?C++ ImageSet::Allocator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageSet
的用法示例。
在下文中一共展示了ImageSet::Allocator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeSets
void ClarkModel::MakeSets(const ImageSet& residualSet)
{
_residual.reset(new ImageSet(
&residualSet.Table(), residualSet.Allocator(),
residualSet.ChannelsInDeconvolution(), residualSet.SquareJoinedChannels(),
residualSet.LinkedPolarizations(),
size(), 1));
_model.reset(new ImageSet(
&residualSet.Table(), residualSet.Allocator(),
residualSet.ChannelsInDeconvolution(), residualSet.SquareJoinedChannels(),
residualSet.LinkedPolarizations(),
size(), 1));
for(size_t imgIndex=0; imgIndex!=_model->size(); ++imgIndex)
{
std::fill((*_model)[imgIndex], (*_model)[imgIndex]+size(), 0.0);
const double* sourceResidual = residualSet[imgIndex];
double* destResidual = (*_residual)[imgIndex];
for(size_t pxIndex=0; pxIndex!=size(); ++pxIndex)
{
size_t srcIndex = _positions[pxIndex].second*_width + _positions[pxIndex].first;
destResidual[pxIndex] = sourceResidual[srcIndex];
}
}
}
示例2: findPeakPositions
void ClarkLoop::findPeakPositions(ImageSet& convolvedResidual)
{
Image integratedScratch(_width, _height, convolvedResidual.Allocator());
convolvedResidual.GetLinearIntegrated(integratedScratch.data());
if(!_rmsFactorImage.empty())
{
integratedScratch *= _rmsFactorImage;
}
const size_t
xiStart = _horizontalBorder, xiEnd = std::max<long>(xiStart, _width - _horizontalBorder),
yiStart = _verticalBorder, yiEnd = std::max<long>(yiStart, _height - _verticalBorder);
if(_mask)
{
for(size_t y=yiStart; y!=yiEnd; ++y)
{
const bool* maskPtr = _mask + y*_width;
double* imagePtr = integratedScratch.data() + y*_width;
for(size_t x=xiStart; x!=xiEnd; ++x)
{
double value;
if(_allowNegativeComponents)
value = fabs(imagePtr[x]);
else
value = imagePtr[x];
if(value >= _threshold && maskPtr[x])
_clarkModel.AddPosition(x, y);
}
}
}
else {
for(size_t y=yiStart; y!=yiEnd; ++y)
{
double* imagePtr = integratedScratch.data() + y*_width;
for(size_t x=xiStart; x!=xiEnd; ++x)
{
double value;
if(_allowNegativeComponents)
value = fabs(imagePtr[x]);
else
value = imagePtr[x];
if(value >= _threshold)
_clarkModel.AddPosition(x, y);
}
}
}
}