LaboratoireMecaniqueLille / crappy

Command and Real-time Acquisition Parallelized in Python
https://crappy.readthedocs.io/en/stable/
GNU General Public License v2.0
78 stars 16 forks source link

camera_config display issues #113

Closed jeffwitz closed 6 months ago

jeffwitz commented 6 months ago

Hello there,

I don't find any way to set the timeout for the camera_config windows to wait in order to display the message "no frame could be grab so far"

It is an issue in the case where you have a very low frame rate. It will be better to stay on the last image. Is there a way to parametrize a timeout in order to stay on the last image before this message appears ?

Regards

WeisLeDocto commented 6 months ago

Hi !

This is a bug, caused by the following sets of lines in the camera_config.py file:

https://github.com/LaboratoireMecaniqueLille/crappy/blob/e069fd4c6cf7209c56833290a24f3f4235c9684c/src/crappy/tool/camera_config/camera_config.py#L144-L158

https://github.com/LaboratoireMecaniqueLille/crappy/blob/e069fd4c6cf7209c56833290a24f3f4235c9684c/src/crappy/tool/camera_config/camera_config.py#L1029-L1044

The problem is that the variable self._n_loops is used to determine whether the error image should be displayed, but self._n_loops gets reset to 0 periodically.

The fix, very straightforward, will be to add a new flag tracking whether any image was acquired at all, and use this new flag to decide whether to display the error image or not. Will be included in ToDo for release 2.0.6, I don't think it's urgent enough for a hotfix release.

Is there a way to parametrize a timeout in order to stay on the last image before this message appears ?

As a side note, there is no notion of time in the decision to display the error message. It's only based on the fact that None was returned by the Camera object instead of an actual image. The timeout, if any, would rather be in the get_image() method of the Camera object.