Hey guys, I am new developing projects with realsense technology, I am working with the R200 camera, Visual studio 2015, C++, Windows 10 and OpenCV 3.1.
I managed to do library integration of the SDK and OpenCV, I can also do RGB streaming and some depth frequencies. For this I followed many turorials and re-engineered the SDK examples.
1. Start the session
2. I make a sense manager
3. Enable different streamings
4. Initialize the sense manager
For development I need to be able to modify the modalities of streaming, but only work the RGB and 2 frequencies and sizes of the depth. I've tried everything, leaving the parameters of size and frequency empty, streaming one by one, but no matter what I do, I do not get IR images.
I do not know if I should do anything else because every attempt to enable IR or other frequencies of depth fails the initialization of the sense manager, and I have already spent 3 weeks on this and I must continue.
Thank you very much.
PXCSession *session = PXCSession::CreateInstance();
PXCSession::ImplVersion ver = session->QueryVersion();
wprintf_s(L"SDK Version %d.%d\n", ver.major, ver.minor);
// Create a SenseManager instance
PXCSenseManager *sm = PXCSenseManager::CreateInstance();
if (sm == NULL)
wprintf_s(L"Sense Manager Initializacion Falied");
else
wprintf_s(L"Sense Manager Initializacion Succeed");
cv::Size frameSize = cv::Size(640, 480);
float frameRate = 60;
pxcCHAR *file(0);
int nframes = 69;
PXCCapture::DeviceInfo dinfo;
// Select the color and depth streams
sm->EnableStream(PXCCapture::STREAM_TYPE_COLOR, 640, 480, 30);
sm->EnableStream(PXCCapture::STREAM_TYPE_DEPTH, 320, 240, 60);
//sm->EnableStream(PXCCapture::STREAM_TYPE_DEPTH, 320, 240, 90);
//sm->EnableStream(PXCCapture::STREAM_TYPE_DEPTH);
//sm->EnableStream(PXCCapture::STREAM_TYPE_IR, 320, 240);
//sm->EnableStream(PXCCapture::STREAM_TYPE_IR);
//sm->EnableStream(PXCCapture::STREAM_TYPE_LEFT);
// Initialize and Stream Samples
pxcStatus initSts = sm->Init();
if (initSts < PXC_STATUS_NO_ERROR)
wprintf_s(L", PXCSenseManager.Init Falied");
else
wprintf_s(L", PXCSenseManager.Init Succeed");
It turns out that the enabling of the streamings should be done depending on the type of synchronization desired.
In my case I want a synchronous sampling, so there must be a relationship between the sampling frequencies for each camera, they must be compatible between them, the same happens with the resolution of the streaming.
The most demanding camera is the infrared so I suggest defining this first.
Finally this is the configuration that worked for me:
PXCSession *session = PXCSession::CreateInstance();
PXCSession::ImplVersion ver = session->QueryVersion();
wprintf_s(L"SDK Version %d.%d\n", ver.major, ver.minor);
// Create a SenseManager instance
PXCSenseManager *sm = PXCSenseManager::CreateInstance();
if (sm == NULL)
wprintf_s(L"Sense Manager Initializacion Falied");
else
wprintf_s(L"Sense Manager Initializacion Succeed");
cv::Size frameSize = cv::Size(320, 240);
float frameRate = 60;
int nframes = 69;
PXCCapture::DeviceInfo dinfo;
// Select the color and depth streams
sm->EnableStream(PXCCapture::STREAM_TYPE_LEFT, 320, 240, 30);
sm->EnableStream(PXCCapture::STREAM_TYPE_RIGHT, 320, 240, 30);
sm->EnableStream(PXCCapture::STREAM_TYPE_COLOR, 320, 240, 30);
sm->EnableStream(PXCCapture::STREAM_TYPE_DEPTH, 320, 240, 30);
// Initialize and Stream Samples
pxcStatus initSts = sm->Init();
if (initSts < PXC_STATUS_NO_ERROR)
wprintf_s(L", PXCSenseManager.Init Falied");
else
wprintf_s(L", PXCSenseManager.Init Succeed");
連結已複製
I found a site with a downloadable script for R200 that displays the left and right IR streams. Have you seen this page already?
http://www.digit.in/apps/intel-realsense-depth-camera-code-sample-r200-camera-streams-28222.html Intel RealSense Depth Camera Code Sample – R200 Camera Streams | Digit.in
It turns out that the enabling of the streamings should be done depending on the type of synchronization desired.
In my case I want a synchronous sampling, so there must be a relationship between the sampling frequencies for each camera, they must be compatible between them, the same happens with the resolution of the streaming.
The most demanding camera is the infrared so I suggest defining this first.
Finally this is the configuration that worked for me:
PXCSession *session = PXCSession::CreateInstance();
PXCSession::ImplVersion ver = session->QueryVersion();
wprintf_s(L"SDK Version %d.%d\n", ver.major, ver.minor);
// Create a SenseManager instance
PXCSenseManager *sm = PXCSenseManager::CreateInstance();
if (sm == NULL)
wprintf_s(L"Sense Manager Initializacion Falied");
else
wprintf_s(L"Sense Manager Initializacion Succeed");
cv::Size frameSize = cv::Size(320, 240);
float frameRate = 60;
int nframes = 69;
PXCCapture::DeviceInfo dinfo;
// Select the color and depth streams
sm->EnableStream(PXCCapture::STREAM_TYPE_LEFT, 320, 240, 30);
sm->EnableStream(PXCCapture::STREAM_TYPE_RIGHT, 320, 240, 30);
sm->EnableStream(PXCCapture::STREAM_TYPE_COLOR, 320, 240, 30);
sm->EnableStream(PXCCapture::STREAM_TYPE_DEPTH, 320, 240, 30);
// Initialize and Stream Samples
pxcStatus initSts = sm->Init();
if (initSts < PXC_STATUS_NO_ERROR)
wprintf_s(L", PXCSenseManager.Init Falied");
else
wprintf_s(L", PXCSenseManager.Init Succeed");