本文整理汇总了C++中mrpt::utils::CImage::grayscale方法的典型用法代码示例。如果您正苦于以下问题:C++ CImage::grayscale方法的具体用法?C++ CImage::grayscale怎么用?C++ CImage::grayscale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mrpt::utils::CImage
的用法示例。
在下文中一共展示了CImage::grayscale方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildPyramid_templ
void buildPyramid_templ(
CImagePyramid &obj,
mrpt::utils::CImage &img,
const size_t nOctaves,
const bool smooth_halves,
const bool convert_grayscale)
{
ASSERT_ABOVE_(nOctaves,0)
//TImageSize img_size = img.getSize();
obj.images.resize(nOctaves);
// First octave: Just copy the image:
if (convert_grayscale && img.isColor())
{
// In this case we have to convert to grayscale, so FASTLOAD doesn't really matter:
img.grayscale(obj.images[0]);
}
else
{
// No need to convert to grayscale OR image already is grayscale:
if (FASTLOAD)
obj.images[0].copyFastFrom(img); // Fast copy -> "move", destroying source.
else obj.images[0] = img; // Normal copy
}
// Rest of octaves, if any:
for (size_t o=1;o<nOctaves;o++)
{
if (smooth_halves)
obj.images[o-1].scaleHalfSmooth(obj.images[o]);
else obj.images[o-1].scaleHalf(obj.images[o]);
}
}