当前位置: 首页>>代码示例>>C++>>正文


C++ DataDescriptor::IsOK方法代码示例

本文整理汇总了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;
}
开发者ID:CharlesXu,项目名称:VisionSDK,代码行数:35,代码来源:base_color_conversion.cpp

示例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;
}
开发者ID:CharlesXu,项目名称:VisionSDK,代码行数:35,代码来源:base_color_conversion.cpp

示例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;
}
开发者ID:CharlesXu,项目名称:VisionSDK,代码行数:36,代码来源:base_color_conversion.cpp

示例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;
}
开发者ID:CharlesXu,项目名称:VisionSDK,代码行数:36,代码来源:base_integral_image.cpp


注:本文中的DataDescriptor::IsOK方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。