本文整理汇总了C++中YARPImageOf::GetAllocatedArray方法的典型用法代码示例。如果您正苦于以下问题:C++ YARPImageOf::GetAllocatedArray方法的具体用法?C++ YARPImageOf::GetAllocatedArray怎么用?C++ YARPImageOf::GetAllocatedArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类YARPImageOf
的用法示例。
在下文中一共展示了YARPImageOf::GetAllocatedArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Apply
void YARPGaussianFeatures::Apply (const YARPImageOf<YarpPixelMono>& in)
{
assert (in.GetPadding() == 0);
for (int i = 1; i <= m_sigmas; i++)
{
m_features(i) = SpecialConvolveX (m_coeffs[i-1], (const unsigned char *)in.GetAllocatedArray());
m_features(i+m_sigmas) = SpecialConvolveY (m_coeffs[i-1], (const unsigned char *)in.GetAllocatedArray());
}
}
示例2: assert
void YARPColorConverter::RGB2Normalized (const YARPImageOf<YarpPixelRGB>& in, YARPImageOf<YarpPixelRGBFloat>& out, float threshold)
{
assert (out.GetIplPointer() != NULL && in.GetIplPointer() != NULL);
assert (out.GetHeight() == in.GetHeight());
assert (out.GetWidth() == in.GetWidth());
unsigned char *inTmp = (unsigned char *) in.GetAllocatedArray();
unsigned char *outTmp = (unsigned char *) out.GetAllocatedArray();
int r = 0;
int c = 0;
int padIn = in.GetPadding();
int padOut = out.GetPadding();
float lum;
float *tmp;
for(r = 0; r<in.GetHeight(); r++)
{
for(c = 0; c < in.GetWidth(); c++)
{
tmp = (float *) outTmp;
lum = (float)( inTmp[0] + inTmp[1] + inTmp[2]);
if (lum > threshold)
{
tmp[0] = inTmp[0]/lum;
tmp[1] = inTmp[1]/lum;
tmp[2] = inTmp[2]/lum;
}
else
{
tmp[0] = 0.0;
tmp[1] = 0.0;
tmp[2] = 0.0;
}
inTmp += 3;
outTmp += 3*sizeof(float);
}
inTmp += padIn;
outTmp += padOut;
}
}