improve depth test - #13967
Conversation
| """ | ||
| import cv2 | ||
| pipeline = rs.pipeline(ctx) | ||
| pipeline_profile = pipeline.start(cfg) |
There was a problem hiding this comment.
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.
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.
This will prepare a new vector with values lower than 10 ?
There was a problem hiding this comment.
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.
And valid_depths will be a vector with real values under 10?
There was a problem hiding this comment.
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
| 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.
debug leftover, will remove
Making some changes to the depth test, those changes should reduce its runtime