Last active
February 7, 2019 20:54
-
-
Save fgolemo/1e15dc27a824c43eccff370825b8485e to your computer and use it in GitHub Desktop.
RGB speed test for the Intel RealSense d435i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import numpy as np | |
import pyrealsense2 as rs | |
pipeline = rs.pipeline() | |
config = rs.config() | |
config.enable_stream(rs.stream.color, 640, 480, rs.format.rgb8, 60) | |
pipeline.start(config) | |
tests = 100 | |
start = time.time() | |
for i in range(tests): | |
frames = pipeline.wait_for_frames() | |
color = frames.get_color_frame() # Avg 0.0349s per frame, i.e. 28.6321Hz | |
if not color: continue | |
diff = (time.time() - start) / tests | |
print("Avg {}s per frame, i.e. {}Hz".format(np.around(diff, 4), np.around(1 / diff, 4))) | |
pipeline.stop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment