本文整理汇总了C++中GrayImage::data方法的典型用法代码示例。如果您正苦于以下问题:C++ GrayImage::data方法的具体用法?C++ GrayImage::data怎么用?C++ GrayImage::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrayImage
的用法示例。
在下文中一共展示了GrayImage::data方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gaussBlur
GrayImage gaussBlur(GrayImage const& src, float h_sigma, float v_sigma)
{
using namespace boost::lambda;
if (src.isNull()) {
return src;
}
GrayImage dst(src.size());
gaussBlurGeneric(
src.size(), h_sigma, v_sigma,
src.data(), src.stride(), StaticCastValueConv<float>(),
dst.data(), dst.stride(), _1 = bind<uint8_t>(RoundAndClipValueConv<uint8_t>(), _2)
);
return dst;
}
示例2: calcScale
void
PolynomialSurface::prepareEquationsAndDataPoints(
GrayImage const& image, BinaryImage const& mask,
std::vector<double>& equations,
std::vector<double>& data_points) const
{
int const width = image.width();
int const height = image.height();
double const xscale = calcScale(width);
double const yscale = calcScale(height);
uint8_t const* image_line = image.data();
int const image_bpl = image.stride();
uint32_t const* mask_line = mask.data();
int const mask_wpl = mask.wordsPerLine();
int const last_word_idx = (width - 1) >> 5;
int const last_word_mask = ~uint32_t(0) << (31 - ((width - 1) & 31));
for (int y = 0; y < height; ++y) {
double const y_adjusted = y * yscale;
int idx = 0;
// Full words.
for (; idx < last_word_idx; ++idx) {
processMaskWord(
image_line, mask_line[idx], idx, y,
y_adjusted, xscale, equations, data_points
);
}
// Last word.
processMaskWord(
image_line, mask_line[idx] & last_word_mask,
idx, y, y_adjusted, xscale, equations, data_points
);
image_line += image_bpl;
mask_line += mask_wpl;
}
}