CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
improve depth test #13967
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
improve depth test #13967
Conversation
""" | ||
import cv2 | ||
pipeline = rs.pipeline(ctx) | ||
pipeline_profile = pipeline.start(cfg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a
pipeline.wait_for_frames()
call between lines 36 & 37
This is gurentee you will have 5 sec of streaming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is needed in addition to the 5 seconds sleep?
return math.floor(in_cm / DETAIL_LEVEL) * DETAIL_LEVEL # rounds the distance according to the given unit | ||
depth_m = np.asanyarray(depth_frame.get_data()).astype(np.float32) * depth_frame.get_units() | ||
|
||
valid_mask = (depth_m < MAX_METERS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will prepare a new vector with values lower than 10 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this create a vector where for every entry we have True if its value is less than 10, otherwise False
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And valid_depths
will be a vector with real values under 10?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, valid_depths
will have the same values as depth_m
wherever valid_mask
is True, if some value in depth_m
is above 10 valid_mask
will hold False for it, and it won't be included in valid_depth
unit-tests/live/frames/test-depth.py
Outdated
frames = pipeline.wait_for_frames() | ||
depth = frames.get_depth_frame() | ||
color = frames.get_color_frame() | ||
now = time.time() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug leftover, will remove
Making some changes to the depth test, those changes should reduce its runtime