- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi!
I'm tring to stream the R200 with Open CV, using this code
http://www.samontab.com/web/2016/04/interfacing-intel-realsense-f200-with-opencv/
I can build the code on Visual Studio but the windows (screens) of RGB, depth and IR are completely black and it's to work.
Ideas?
Thanks
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code looks fine. I suppose its a realsense problem.
Do the samples from the SDK sample browser work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes they work good! It doesn't work just when I try to open from Open CV
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try saving the images to disk with cv::imwrite, and check those images with a photo viewer. Maybe you have some issues with the highgui library (the library part dedicated to drawing on a window)
You can also check the contents of the data coming from the RealSense camera at the appropriate time.
Maybe there's a problem at the conversion of the formats. Read the comment in the page.
And, of course, you need light :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe you are not linking the correct libraries?
OpenCV really has nothing to do with the camera acquisition...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is a simplified version of what works for me
PXCImage *color_image = sample->color; PXCImage::ImageInfo color_info = color_image->QueryInfo(); PXCImage::ImageData color_data; color_image->AcquireAccess(PXCImage::ACCESS_READ, PXCImage::PIXEL_FORMAT_RGB32, &color_data); IplImage* colorimg = cvCreateImageHeader(cvSize(color_info.width, color_info.height), 8, 4); cvSetData(colorimg, color_data.planes[0], color_info.width * 4 * sizeof(pxcBYTE)); Mat color_img_mat = cvarrToMat(colorimg); color_image->ReleaseAccess(&color_data);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Remember to set the IR stream to 8 bits (PXCImage::PIXEL_FORMAT_Y8
), in OpenCV you use CV_8UC1
.
And also set the pitch/step in both directions of the conversion, like this in each case:
data.pitches[0] = cvImage.step
cv::Mat ocvImage = cv::Mat(cv::Size(width, height), type, data.planes[0], data.pitches[0]);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
samontab wrote:
Remember to set the IR stream to 8 bits (PXCImage::PIXEL_FORMAT_Y8), in OpenCV you use CV_8UC1.
And also set the pitch/step in both directions of the conversion, like this in each case:
data.pitches[0] = cvImage.step
cv::Mat ocvImage = cv::Mat(cv::Size(width, height), type, data.planes[0], data.pitches[0]);
forgive me my questions, but where to set the stream to 8 bits?
as for now i only activate the stream by the sense manager over
PXCSenseManager *sm=PXCSenseManager::CreateInstance();
sm->EnableStream(PXCCapture::STREAM_TYPE_IR,320,240);
thank you samontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you access the image data from the IR stream:
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page