77import cv2
88
99import ArducamEvkSDK
10- from ArducamEvkSDK import Camera , Frame , Param
1110import arducam_rgbir_remosaic
1211
1312from . import base_camera
1413
14+ CAMERA_CONFIG_DIR = "./config/camera_config.cfg"
15+
1516
1617class ArducamOutput (enum .Enum ):
1718 """
@@ -34,13 +35,12 @@ def create(
3435 cls , width : int , height : int , config : None
3536 ) -> "tuple[True, CameraArducamIR] | tuple[False, None]" :
3637
37- camera = Camera ()
38+ camera = ArducamEvkSDK . Camera ()
3839
39- param = Param ()
40- param .config_file_name = "./config/camera_config.cfg"
40+ param = ArducamEvkSDK . Param ()
41+ param .config_file_name = CAMERA_CONFIG_DIR
4142
4243 if not camera .open (param ):
43- print ("Error trying to open Arducam camera" )
4444 return False , None
4545
4646 return True , CameraArducamIR (cls .__create_key , camera )
@@ -66,7 +66,7 @@ def __del__(self) -> None:
6666 self .__camera .stop ()
6767 self .__camera .close ()
6868
69- def run (self ) -> tuple [True , Frame ] | tuple [False , None ]:
69+ def run (self ) -> tuple [True , ArducamEvkSDK . Frame ] | tuple [False , None ]:
7070 """
7171 Takes a picture with ArducamIR camera.
7272
@@ -78,7 +78,7 @@ def run(self) -> tuple[True, Frame] | tuple[False, None]:
7878
7979 return True , image_data
8080
81- def demosaic (self , image : Frame , output : ArducamOutput ) -> np .ndarray | None :
81+ def demosaic (self , image : ArducamEvkSDK . Frame , output : ArducamOutput ) -> np .ndarray | None :
8282 """
8383 Converts Bayer Pattern & IR data to OpenCV Matrix
8484 """
@@ -98,7 +98,7 @@ def demosaic(self, image: Frame, output: ArducamOutput) -> np.ndarray | None:
9898 return ir_resize
9999 raise ValueError (f"Error. Invalid output type: { output } " )
100100
101- def format (self , image : Frame ) -> np .ndarray :
101+ def format (self , image : ArducamEvkSDK . Frame ) -> np .ndarray :
102102 """
103103 Formats byte buffer sensor input into 8-bit arrays
104104 """
0 commit comments