0

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?.

Ian
  • 30,182
  • 19
  • 69
  • 107
Alexander Leon VI
  • 499
  • 1
  • 4
  • 18

1 Answers1

1

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);
HenningJ
  • 3,099
  • 1
  • 20
  • 17
  • Yes I've found that PXCAccelerator is not available any more. Do you know where I can find an example of how to do this? – Alexander Leon VI Jan 11 '16 at 15:51
  • Haven't tried it myself, but I'd guess you'd only have to change your last line to `dst_img = session->CreateImage(&info, &data);` or something like that. – HenningJ Jan 12 '16 at 09:01
  • 0k, I've started a bounty in a question similar to this one, but at the beginning I was confused and at the edge of desperation so I didn't realize that the question is too different of what I want. If you post some stuff [there](http://stackoverflow.com/questions/32174076/how-to-save-an-image-in-intel-realsensevisual-c) I will give you the bounty. – Alexander Leon VI Jan 12 '16 at 15:35
  • Hi, I would like to ask your help for [this](https://software.intel.com/en-us/forums/realsense/topic/606665#comment-1855954), Regards – Alexander Leon VI Jan 13 '16 at 15:41