File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/crappy/tool/camera_config Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1018,8 +1018,12 @@ def _update_img(self) -> None:
1018
1018
1019
1019
ret = self ._camera .get_image ()
1020
1020
1021
+ # Flag raised if no image could be grabbed
1022
+ no_img = False
1023
+
1021
1024
# If no frame could be grabbed from the camera
1022
1025
if ret is None :
1026
+ no_img = True
1023
1027
# If it's the first call, generate error image to initialize the window
1024
1028
if not self ._n_loops :
1025
1029
self .log (logging .WARNING , "Could not get an image from the camera, "
@@ -1036,9 +1040,9 @@ def _update_img(self) -> None:
1036
1040
self ._n_loops += 1
1037
1041
_ , img = ret
1038
1042
1039
- if img .dtype != self .dtype :
1043
+ if not no_img and img .dtype != self .dtype :
1040
1044
self .dtype = img .dtype
1041
- if self .shape != img .shape :
1045
+ if not no_img and img .shape != self .shape :
1042
1046
self .shape = img .shape
1043
1047
1044
1048
self ._cast_img (img )
You can’t perform that action at this time.
0 commit comments