本文整理汇总了C++中Image::Contains方法的典型用法代码示例。如果您正苦于以下问题:C++ Image::Contains方法的具体用法?C++ Image::Contains怎么用?C++ Image::Contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Image
的用法示例。
在下文中一共展示了Image::Contains方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UndistortImage
void UndistortImage(
const Image& imageIn,
const IntrinsicBase * cam,
Image & image_ud,
typename Image::Tpixel fillcolor = typename Image::Tpixel(0))
{
if (!cam->have_disto()) // no distortion, perform a direct copy
{
image_ud = imageIn;
}
else // There is distortion
{
image_ud.resize(imageIn.Width(), imageIn.Height(), true, fillcolor);
const image::Sampler2d<image::SamplerLinear> sampler;
#ifdef OPENMVG_USE_OPENMP
#pragma omp parallel for
#endif
for (int j = 0; j < imageIn.Height(); ++j)
for (int i = 0; i < imageIn.Width(); ++i)
{
const Vec2 undisto_pix(i,j);
// compute coordinates with distortion
const Vec2 disto_pix = cam->get_d_pixel(undisto_pix);
// pick pixel if it is in the image domain
if ( imageIn.Contains(disto_pix(1), disto_pix(0)) )
image_ud( j, i ) = sampler(imageIn, disto_pix(1), disto_pix(0));
}
}
}
示例2: Warp
void Warp(const Image &im, const Mat3 & H, Image &out)
{
const int wOut = static_cast<int>(out.Width());
const int hOut = static_cast<int>(out.Height());
for (int j = 0; j < hOut; ++j)
#ifdef USE_OPENMP
#pragma omp parallel for
#endif
for (int i = 0; i < wOut; ++i)
{
double xT = i, yT = j;
if (ApplyH_AndCheckOrientation(H, xT, yT)
&& im.Contains(yT,xT))
out(j,i) = SampleLinear(im, (float)yT, (float)xT);
}
}