You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't reach 60 fps as described in the datasheet, I'm connected using the original Cable to USB 3.1 port, using realsense-viewer it says ~ 58 - 59 FPS, but I can't reach the same FPS using python.
#!/usr/bin/env python3importtimeimportnumpyasnpimportpyrealsense2.pyrealsense2asrsclassRS_FPS:
def__init__(self):
# Start reading framesself.pipeline=rs.pipeline()
config=rs.config()
# RGB Stream USB 3.1 / FPI 60 doesn't work with USB 2.0config.enable_stream(rs.stream.color, 640, 480, rs.format.bgr8, 60) # bgr8/rgb8config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 60)
# Start streamingself.pipeline.start(config)
sensor=self.pipeline.get_active_profile().get_device().query_sensors()[1]
sensor.set_option(rs.option.enable_auto_exposure, True)
sensor.set_option(rs.option.auto_exposure_priority, False)
align_to=rs.stream.colorself.align=rs.align(align_to)
defrun(self):
nb_frames=0self.tic=time.time()
whileTrue:
# Get frameset of color and depthframes=self.pipeline.wait_for_frames()
# Align the depth frame to color framealigned_frames=self.align.process(frames)
# Get aligned frames# aligned_depth_frame is a 640x480 depth imagealigned_depth_frame=aligned_frames.get_depth_frame()
color_frame=aligned_frames.get_color_frame()
# Validate that both frames are validifnotaligned_depth_frameornotcolor_frame:
continuedepth_image=np.asanyarray(aligned_depth_frame.get_data())
color_image=np.asanyarray(color_frame.get_data())
self.toc=time.time()
nb_frames+=1delta_time=self.toc-self.ticcur_fps=np.around(nb_frames/delta_time, 1)
print("FPS: {}".format(cur_fps))
if__name__=="__main__":
RS_FPS_=RS_FPS()
RS_FPS_.run()
The text was updated successfully, but these errors were encountered:
Hi @bhomaidan1990 Comparing frames to time to calculate an FPS value may not be accurate. At #7488 (comment) a RealSense team member provides technical information about how FPS is calculated in the RealSense SDK.
You could instead retrieve the camera metadata parameter ACTUAL_FPS
Issue Description
I can't reach 60 fps as described in the datasheet, I'm connected using the original Cable to USB 3.1 port, using
realsense-viewer
it says ~ 58 - 59 FPS, but I can't reach the same FPS using python.The text was updated successfully, but these errors were encountered: