Search code examples
intellisenseintelrealsense

PXCAccelerator is undefined


Hi I am trying to load an extern image into a PXCImage object. I pretend to use this function:

void LoadImageFromLocal(PXCSession* session, PXCImage **dst_img, const char * path)
{
  IplImage *image = cvLoadImage(path);
  unsigned char *rgb_data;
  int rgb_pitch = image->widthStep; // bytes between image lines

  rgb_data = (unsigned char*)image->imageData;
  PXCAccelerator * accelerator;
  session->CreateAccelerator(PXCAccelerator::ACCEL_TYPE_CPU, &accelerator);

  PXCImage::ImageInfo info;
  memset(&info, 0, sizeof(info));
  info.height = image->height;
  info.width = image->width;
  info.format = PXCImage::PIXEL_FORMAT_RGB24;

  PXCImage::ImageData data;
  memset(&data, 0, sizeof(data));
  data.format = PXCImage::PIXEL_FORMAT_RGB24;
  data.planes[0] = rgb_data;
  data.pitches[0] = rgb_pitch;

  pxcStatus sts = accelerator->CreateImage(&info, 0, &data, dst_img);
}

But in my code the PXCAccelerator class appears as undefined. I am using this libraries: #include "pxcsensemanager.h" and #include "pxcemotion.h". I have the 2014 RSSDK version. What library should I use to access to the PXCAccelerator class?.


Solution

  • Looks like the PXCAccelerator was part of the (now deprecated) Intel Perceptual Computing SDK, but doesn't exist in the Intel RealSense SDK.

    Now you should use PXCSession::CreateImage instead:

        PXCImage* CreateImage(PXCImage::ImageInfo *info, PXCImage::ImageData *data);