Hello, i'm sorry for serial question, but i can't find place where can i ask some problem directly about RealSense SDK.
Question)
I referenced below sentence in visual studio.
static rs2::frameset current_frameset;
than, i want convert this "current_frameset" variable to iplimage for using openCV.
how can i change this one? (exactly, rs2::video_frame -> CvCapture * )
i tried this one,
cv::Mat img(480,640, CV_8UC3, (uchar3 *)frame->get_frame_data(rs2::stream::current_frameset));
but it came up only error that i can't understand.
so, i wish sentence like " frame = Cv ... " (frame is iplimage variable)
thank for help!
The article below discusses doing the conversion with the older R200 and SR300 camera models in Librealsense 1, and may give you some hints that you can adapt for RS2.
For example, one suggestion for an approach is:
IplImage *I = cvCreateImageHeader(cvSize(dc_frame->size[0],dc_frame->size[1]),IPL_DEPTH_8U,1);
cvSetData(I,dc_frame->image,dc_frame->size[0]);
http://answers.opencv.org/question/128296/realsense-r200-difference-between-saved-images-and-live-stream/ realsense R200, difference between saved images and live stream? - OpenCV Q&A Forum
連結已複製
The article below discusses doing the conversion with the older R200 and SR300 camera models in Librealsense 1, and may give you some hints that you can adapt for RS2.
For example, one suggestion for an approach is:
IplImage *I = cvCreateImageHeader(cvSize(dc_frame->size[0],dc_frame->size[1]),IPL_DEPTH_8U,1);
cvSetData(I,dc_frame->image,dc_frame->size[0]);
http://answers.opencv.org/question/128296/realsense-r200-difference-between-saved-images-and-live-stream/ realsense R200, difference between saved images and live stream? - OpenCV Q&A Forum
Bear in mind that I am adapting an instruction to convert cv::VideoCapture to CvCapture, so this may be wrong. You could try:
rs2::video_frame capture1(fileName);
if (!capture.isOpened())
{
// failed, print error message
}
****************
I believe that in the above script, capture1 is a custom variable name chosen by its author and you could use your own name.
