Skip to content

improve depth test - #13967

Merged
Nir-Az merged 2 commits into
realsenseai:developmentfrom
AviaAv:depth-improvement
Apr 29, 2025
Merged

improve depth test#13967
Nir-Az merged 2 commits into
realsenseai:developmentfrom
AviaAv:depth-improvement

Conversation

@AviaAv

@AviaAv AviaAv commented Apr 28, 2025

Copy link
Copy Markdown
Contributor

Making some changes to the depth test, those changes should reduce its runtime

@AviaAv
AviaAv requested a review from Nir-Az April 28, 2025 09:31
"""
import cv2
pipeline = rs.pipeline(ctx)
pipeline_profile = pipeline.start(cfg)

Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Contributor Author

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)

Copy link
Copy Markdown
Collaborator

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 ?

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Collaborator

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?

Copy link
Copy Markdown
Contributor Author

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

Comment thread 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()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug leftover, will remove

@Nir-Az
Nir-Az merged commit 2b9f875 into realsenseai:development Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants