First time here? Check out the FAQ!

Ask Your Question
0

RGBD based depth data capture

asked Oct 2 '14

SumitM gravatar image

Hi, I was wondering if it's possible to save depth data in a way similar to video format? I am able to save it a jpg image as well as export depth data to a csv, if that helps in anyway. i am kinda new to the image processing and any help will be greatly appreciated. Thanks in advance, Sumit

Preview: (hide)

2 answers

Sort by » oldest newest most voted
0

answered Oct 3 '14

If you want to store your data in a video format, then simply do it by pushing your resulting images into a VideoWriter stream. More info in the documentation!

A code snippet that illustrates the idea

// Create globally a VideoWriter element
// Adapt parameters to your needs
VideoWriter video_output ("~/video.avi", CV_FOURCC("M","J","P","G"), 25, Size(480, 640), true);

// Matrix containing the dept data
// Use your previous processing to push data into this
Mat depth_data;

// Push the image to the video stream
depth_data >> video_output;
Preview: (hide)

Comments

1

Thanks Steven (StevenPuttemans).......that seems more appropriate!!!

SumitM gravatar imageSumitM (Oct 10 '14)edit

Do accept the solution if this is what you need :)

StevenPuttemans gravatar imageStevenPuttemans (Oct 11 '14)edit

It would if I could somehow access depth sensor in my RGBD camera. Do you know anyway of doing it? Please refer to my question at http://answers.opencv.org/question/44089/depth-sensor-streaming-in-rgbd-camera/ and let me know if you need any clarification. Thanks in advance!!!

SumitM gravatar imageSumitM (Oct 11 '14)edit

Afaik a depth sensor returns a RGBD image so you juyst need to grab the 4th channel.

StevenPuttemans gravatar imageStevenPuttemans (Oct 11 '14)edit
0

answered Oct 2 '14

juanmanpr gravatar image

Something like this could work for you?

cv::FileStorage fs("data.xml", cv::FileStorage::WRITE);
std::vector<cv::Mat> rgbdData;
fs << rgbdData;
Preview: (hide)

Comments

Thanks, I will give it a try :)

SumitM gravatar imageSumitM (Oct 3 '14)edit
1

QUOTE: I was wondering if it's possible to save depth data in a way similar to video format I am sorry but XML data is far from a video format. I do not think this is what the author requested.

StevenPuttemans gravatar imageStevenPuttemans (Oct 3 '14)edit

Question Tools

1 follower

Stats

Asked: Oct 2 '14

Seen: 745 times

Last updated: Oct 03 '14