@@ -24,19 +24,20 @@ class BaseCamera(ABC):
2424 """
2525
2626 def __init__ (self , resolution : Optional [Tuple [int , int ]] = (640 , 480 ), fps : int = 10 ,
27- adjuster : Optional [Callable [[np .ndarray ], np .ndarray ]] = None , ** kwargs ):
27+ adjustments : Optional [Callable [[np .ndarray ], np .ndarray ]] = None , ** kwargs ):
2828 """
2929 Initialize the camera base.
3030
3131 Args:
3232 resolution (tuple, optional): Resolution as (width, height). None uses default resolution.
3333 fps (int): Frames per second for the camera.
34- adjuster (callable, optional): Function pipeline to adjust frames that takes a numpy array and returns a numpy array. Default: None
34+ adjustments (callable, optional): Function or function pipeline to adjust frames that takes
35+ a numpy array and returns a numpy array. Default: None
3536 **kwargs: Additional camera-specific parameters.
3637 """
3738 self .resolution = resolution
3839 self .fps = fps
39- self .adjuster = adjuster
40+ self .adjustments = adjustments
4041 self ._is_started = False
4142 self ._cap_lock = threading .Lock ()
4243 self ._last_capture_time = time .monotonic ()
@@ -100,11 +101,11 @@ def _extract_frame(self) -> Optional[np.ndarray]:
100101
101102 self ._last_capture_time = time .monotonic ()
102103
103- if self .adjuster is not None :
104+ if self .adjustments is not None :
104105 try :
105- frame = self .adjuster (frame )
106+ frame = self .adjustments (frame )
106107 except Exception as e :
107- raise CameraTransformError (f"Frame transformation failed ({ self .adjuster } ): { e } " )
108+ raise CameraTransformError (f"Frame transformation failed ({ self .adjustments } ): { e } " )
108109
109110 return frame
110111
0 commit comments