Items with no label
3335 Discussions

What is the fastest possible time it takes to, using code, access a camera and then get a depth frame?

KChow4
Beginner
950 Views

Hi,

 

I was testing with the D415 camera to find out how long it took, via code, to access the camera device and capture a single frame.

 

When testing using the code snippet below, I noticed that it actually took a second or so to do this.

 

Do RealSense cameras normally take this long to run code like this and is there a faster way to access the camera and take a frame using code (aside from dropping the number of frames that it waits for when stabilizing)?

 

Thanks in advance!

// Declare RealSense pipeline, encapsulating the actual device and sensors rs2::pipeline c_pipe; //Set the configurations rs2::config c_cfg; c_cfg.enable_device(serial_no); //Changes in the resolution of the stream c_cfg.enable_stream(RS2_STREAM_COLOR, 848, 480, RS2_FORMAT_BGR8, 30); // Start streaming with the defined configurations c_pipe.start(c_cfg); //Declaration of frameset rs2::frameset data; //Stablize frames for (int i = 0; i < 30; i++) { data = c_pipe.wait_for_frames(); }   //Get frame rs2::frame colour = data.get_color_frame();

 

0 Kudos
2 Replies
MartyG
Honored Contributor III
357 Views

I went over your code and could not see any obvious problems.

 

The SDK documentation's section on latency may give some useful insight.

 

https://github.com/IntelRealSense/librealsense/wiki/Frame-Buffering-Management-in-RealSense-SDK-2.0#latency-vs.-performance

KChow4
Beginner
357 Views

Thanks, I will check it out!

0 Kudos
Reply