Skip to content

Commit

Permalink
debugging image acq
Browse files Browse the repository at this point in the history
  • Loading branch information
dyka3773 committed Dec 9, 2023
1 parent 56bced8 commit 27afa71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Empty file added Rocket/archive/imgs/.gitkeep
Empty file.
12 changes: 7 additions & 5 deletions Rocket/archive/test_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,16 @@ def acquire_images_for(device: eb.PvDevice, stream: eb.PvStream, record_for: int
# TODO: Add a timestamp to the image name
# IDEA: Also add the frame rate and bandwidth to the image name for debugging purposes
img_name = f"img_{time.perf_counter()}_fps_{frame_rate_val:.1f}_bw_{bandwidth_val / 1000000.0:.1f}.jpg"

time_when_starting_to_save_img = time.perf_counter()
cv2.imwrite(img_name, image_data)
time_when_img_saved = time.perf_counter()

else:
logging.warn(
" Payload type not supported by this sample")
print(
f"Time to save image: {time_when_img_saved - time_when_starting_to_save_img}")

logging.info(
f" {frame_rate_val:.1f} FPS {bandwidth_val / 1000000.0:.1f} Mb/s")
else:
logging.warn("Payload type not supported by this sample")
else:
# Non OK operational result
logging.error(operational_result.GetCodeString())
Expand Down

0 comments on commit 27afa71

Please sign in to comment.