Skip to content

Commit

Permalink
PR #12334 from AviaAv: Removed third test comparing laser on/off
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az authored Oct 29, 2023
2 parents 7ca664e + f8050e5 commit 9ed7daf
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions unit-tests/live/image-quality/test-image-quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def display_image(img):
pass


def frames_to_image(depth, color, save, display):
def frames_to_image(depth, color, save, display, laser_enabled):
"""
This function gets depth and color frames, transforms them to an image (numpy array)
and then save and/or display
Expand All @@ -72,7 +72,7 @@ def frames_to_image(depth, color, save, display):
img = np.concatenate((depth_image, color_image), axis=1)

if save:
file_name = "output_stream.png"
file_name = f"output_stream{'_laser_on' if laser_enabled else '_laser_off'}.png"
log.i("Saved image in", os.getcwd() + "\\" + file_name)
cv2.imwrite(file_name, img)
if display:
Expand Down Expand Up @@ -155,7 +155,7 @@ def is_depth_meaningful(config, laser_enabled=True, save_image=False, show_image

# save or display image (only possible through manual debugging)
if save_image or show_image:
frames_to_image(depth, color, save_image, show_image)
frames_to_image(depth, color, save_image, show_image, laser_enabled)

# Goes over the distances found, and checks if any distance is the same on more than 90% of the pixels
meaningful_depth = True
Expand Down Expand Up @@ -183,9 +183,10 @@ def is_depth_meaningful(config, laser_enabled=True, save_image=False, show_image

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

test.start("Testing less black pixels with the laser on")
test.check(no_laser_black_pixels > laser_black_pixels)
test.finish()
# Test temporarily removed,
# test.start("Testing less black pixels with the laser on")
# test.check(no_laser_black_pixels > laser_black_pixels)
# test.finish()

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

Expand Down

0 comments on commit 9ed7daf

Please sign in to comment.