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

image quality test - adding comparison to laser off if depth is detected #12449

Merged
merged 2 commits into from
Dec 3, 2023

Conversation

AviaAv
Copy link
Contributor

@AviaAv AviaAv commented Nov 27, 2023

Tracked on [LRS-902]

@AviaAv AviaAv requested a review from Nir-Az November 27, 2023 13:42
@@ -172,10 +172,20 @@ def is_depth_meaningful(config, laser_enabled=True, save_image=False, show_image
################################################################################################

test.start("Testing depth frame - laser ON -", dev.get_info(rs.camera_info.name))
res, laser_black_pixels = is_depth_meaningful(cfg, laser_enabled=True, save_image=DEBUG_MODE, show_image=DEBUG_MODE)
res = False
Copy link
Collaborator

Choose a reason for hiding this comment

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

res / result is confusing, please rename and add comments

test.check(res is True)
test.finish()

################################################################################################

if res is True:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we condition it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I figured that if we have no depth in the frame, there is no point in comparing it to the frame without the laser, because the frame might be mostly black pixels anyway

Copy link
Collaborator

Choose a reason for hiding this comment

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

And the previous will fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The comparison? It might fail, yes, not guaranteed but it can happen, but I don't think it indicates anything.
I can remove the condition if needed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I want to make sure we don't get test-pass when actually nothing worked as expected :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if res is false we will get test failed, if it is true, we will do the second test and see if it passes

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add a comment explaining it

res, laser_black_pixels = is_depth_meaningful(cfg, laser_enabled=True, save_image=DEBUG_MODE, show_image=DEBUG_MODE)
res = False
max_black_pixels = float('inf')
for i in range(5):
Copy link
Collaborator

Choose a reason for hiding this comment

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

please add a cooment why we do this loop and maybe use a const global variable for FRAMES_TO_CHECK = 5?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Did it really help? The 5 loop?
Do you think it is stable?
We can increase to 30
But we need it 100% stable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It can help, mostly it helps if there's no depth found, but it's best to find the frame with the least black pixels anyway.
From what I've seen it is stable - if there is no depth the test will fail, if there is, they both should pass

Copy link
Collaborator

@Nir-Az Nir-Az left a comment

Choose a reason for hiding this comment

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

LGTM, lets monitor it and see if it's stable

@Nir-Az Nir-Az merged commit bfe95cd into IntelRealSense:development Dec 3, 2023
16 checks passed
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