本文整理汇总了C++中DataDescriptor::IsOK方法的典型用法代码示例。如果您正苦于以下问题:C++ DataDescriptor::IsOK方法的具体用法?C++ DataDescriptor::IsOK怎么用?C++ DataDescriptor::IsOK使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataDescriptor
的用法示例。
在下文中一共展示了DataDescriptor::IsOK方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_rgb565_to_rgb888
int test_rgb565_to_rgb888(const unsigned short *src, int w, int h)
{
int lRetVal = 0;
apexcv::ColorConverter rgb;
DataDescriptor srcImg;
srcImg.InitManual(w, h, (void *)src, (void *)OAL_MemoryReturnAddress((void *)src, ACCESS_PHY), DATATYPE_16U);
DataDescriptor dstImg(w, h, DATATYPE_32U);
DataDescriptor dstRefImg(w, h, DATATYPE_32U);
if(srcImg.IsOK() && dstImg.IsOK() && dstRefImg.IsOK()) {
//run implementation
lRetVal |= rgb.convert(srcImg, dstImg, apexcv::ColorConverter::RGB565_TO_RGB888);
//obtain dst data pointers
unsigned int* pDst = (unsigned int*) dstImg.GetDataPtr();
unsigned int* pDstRef = (unsigned int*) dstRefImg.GetDataPtr();
//run reference
rgb565_to_rgb888_ref(pDstRef, w, src, w, w, h);
if (dstImg == dstRefImg)
lRetVal |= 0;
else
lRetVal |= 1;
} else {
lRetVal |= 1;
}
//free buffers
dstImg.SetFreeOnExit(true);
dstRefImg.SetFreeOnExit(true);
return lRetVal;
}
示例2: test_rgb888_to_yuv
int test_rgb888_to_yuv(const unsigned char *src, int w, int h)
{
int lRetVal = 0;
apexcv::ColorConverter rgb;
DataDescriptor srcImg;
srcImg.InitManual(w/*/4*/, h, (void *)src, (void *)OAL_MemoryReturnAddress((void *)src, ACCESS_PHY), DATATYPE_08U, 4, 1);
DataDescriptor dstImg(w/*/4*/, h, DATATYPE_08U, 4, 1);
DataDescriptor dstRefImg(w/*/4*/, h, DATATYPE_08U, 4, 1);
if(srcImg.IsOK() && dstImg.IsOK() && dstRefImg.IsOK()) {
//run implementation
lRetVal |= rgb.convert(srcImg, dstImg, ColorConverter::RGB888_TO_YUV);
//obtain dst data pointers
unsigned char* pDst = (unsigned char*) dstImg.GetDataPtr();
unsigned char* pDstRef = (unsigned char*) dstRefImg.GetDataPtr();
//run reference
rgb888_to_yuv_ref((uint8_t*)pDstRef, w*4, (uint8_t*)src, w*4, w, h);
if (dstImg == dstRefImg)
lRetVal |= 0;
else
lRetVal |= 1;
} else {
lRetVal |= 1;
}
//free buffers
dstImg.SetFreeOnExit(true);
dstRefImg.SetFreeOnExit(true);
return lRetVal;
}
示例3: test_ht_8UC3_to_y
int test_ht_8UC3_to_y(const uint8_t *src, int w, int h, uint8_t KA, uint8_t KB, uint8_t KC, uint16_t KR)
{
int lRetVal = 0;
apexcv::OPT::ColorConverter rgb;
DataDescriptor srcImg;
srcImg.InitManual(w/*/4*/, h, (void *)src, (void *)OAL_MemoryReturnAddress((void *)src, ACCESS_PHY), DATATYPE_08U, 4, 1);
DataDescriptor dstImg(w/*/4*/, h, DATATYPE_16S);
DataDescriptor dstRefImg(w/*/4*/, h, DATATYPE_16S);
if(srcImg.IsOK() && dstImg.IsOK() && dstRefImg.IsOK()) {
//run implementation
lRetVal |= rgb.convert(srcImg, dstImg, OPT::ColorConverter::HT_8UC3_TO_Y, KA, KB, KC, KR);
//obtain dst data pointers
int16_t* pDst = (int16_t*) dstImg.GetDataPtr();
int16_t* pDstRef = (int16_t*) dstRefImg.GetDataPtr();
//run reference
csc_8UC3_to_y_ref((int16_t*)pDstRef, w, (uint8_t*)src, w*4, w, h, KA, KB, KC, KR);
if (dstImg == dstRefImg)
lRetVal |= 0;
else
lRetVal |= 1;
} else {
lRetVal |= 1;
}
//free buffers
dstImg.SetFreeOnExit(true);
dstRefImg.SetFreeOnExit(true);
return lRetVal;
}
示例4: test_integral_image
int test_integral_image(const unsigned char *src, int w, int h)
{
int lRetVal = 0;
apexcv::IntegralImage i;
DataDescriptor srcImg;
srcImg.InitManual(w, h, (void *)src, (void *)OAL_MemoryReturnAddress((void *)src, ACCESS_PHY), DATATYPE_08U);
DataDescriptor dstImg(w, h, DATATYPE_32U);
DataDescriptor dstRefImg(w, h, DATATYPE_32U);
if(srcImg.IsOK() &&dstImg.IsOK() && dstRefImg.IsOK()) {
//run implementation
lRetVal |= i.exec(srcImg, dstImg);
//obtain dst data pointers
unsigned int* pDst = (unsigned int*) dstImg.GetDataPtr();
unsigned int* pDstRef = (unsigned int*) dstRefImg.GetDataPtr();
//run reference
integral_image_ref(pDstRef, src, w, w, h);
if (dstImg == dstRefImg)
lRetVal |= 0;
else
lRetVal |= 1;
} else {
lRetVal |= 1;
}
//free buffers
dstImg.SetFreeOnExit(true);
dstRefImg.SetFreeOnExit(true);
return lRetVal;
}