IntelRealSense / RealSenseID

Intel® RealSense™ ID SDK
https://intelrealsense.com/facial-authentication/
Apache License 2.0
98 stars 57 forks source link

Starting and stopping f455 camera with Python #107

Open zeynepkoyun opened 3 years ago

zeynepkoyun commented 3 years ago

Hi @gabime, @benlev In the examples we looked at by considering the "viewer.py" code in Python, we can start the camera and take its image with the following two lines. "p = rsid_py.Preview(preview_cfg) p.start(on_image)"

However, in the stop part of the camera, the application is closed directly by using the "os._exit(0)" line. I would appreciate if you can help us how to stop the camera without closing the application.

RealSenseSupport commented 2 years ago

There is the "stop" method in Preview class. https://github.com/IntelRealSense/RealSenseID/blob/master/wrappers/python/preview_py.cc#L100

You can delete the line "os._exit(0)" in the callback.