Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get the number of points from a depth frame #8007

Closed
louis-etne opened this issue Dec 15, 2020 · 5 comments
Closed

Get the number of points from a depth frame #8007

louis-etne opened this issue Dec 15, 2020 · 5 comments

Comments

@louis-etne
Copy link

Required Info
Camera Model D435
Operating System & Version Linux
Language C++

Issue Description

I need to get the number of points from a depth frame after being processed by each filters. So for the moment I use this:

rs_points = rs_pointcloud.calculate(f);
output << rs_points.size() << ";";

But it is extremely slow, without I can process approx 40 frames per second and with it I drop to only 13 frames per second. My question is, is there a way to get the number of points from a depth frame directly ?

Thanks for your help.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Dec 15, 2020

Hi @louis-etne Do you have different results if you use std::cout instead of display?

std::cout << rs_points.size() << ";";

Would it also be practical to put the value printing code within a keypress check so that it only updates the value when a particular key is pressed? For example, the C++ script in the link below has a mechanism for checking if 'q' is pressed and take an action if the key is pressed.

#6337

image

@louis-etne
Copy link
Author

Thanks for your answer.

Unfortunately, my code doesn't take any user input, it runs by itself on a headless raspberry pi. I need to get the number of points from the depth frame within an infinite loop where all the processing appends and write the result to a csv file to analyse the timing after. And i need to get the number of points after each filter, so I need it to be quick.

@MartyG-RealSense
Copy link
Collaborator

Writing to csv in librealsense is slow. The most efficient recording method is a bag file, though it requires a large storage drive because the file sizes can be tens of gigabytes for a prolonged recording duration..

#1485 (comment)

@MartyG-RealSense
Copy link
Collaborator

Hi @louis-etne Do you require further assistance with this case, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants