pequenos ajustes
This commit is contained in:
parent
f0f175d751
commit
7f8159d7a8
|
|
@ -179,7 +179,7 @@ def main():
|
|||
print("============================================")
|
||||
|
||||
beauty_preview = False
|
||||
radiometric_ae = True
|
||||
radiometric_ae = False
|
||||
auto_save = False
|
||||
last_auto_t = 0.0
|
||||
preview_upscale = args.preview_upscale
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
"rgb": {
|
||||
"ae_enable": false,
|
||||
"awb_enable": false,
|
||||
"exposure_time_us": 20000,
|
||||
"analogue_gain": 1.2100000000000002,
|
||||
"exposure_time_us": 3000,
|
||||
"analogue_gain": 1.21,
|
||||
"colour_gains": [
|
||||
1.0,
|
||||
1.0
|
||||
|
|
@ -22,14 +22,14 @@
|
|||
"re": {
|
||||
"ae_enable": false,
|
||||
"awb_enable": false,
|
||||
"exposure_time_us": 20000,
|
||||
"exposure_time_us": 5000,
|
||||
"analogue_gain": 1.0,
|
||||
"colour_gains": null
|
||||
},
|
||||
"nir": {
|
||||
"ae_enable": false,
|
||||
"awb_enable": false,
|
||||
"exposure_time_us": 20000,
|
||||
"exposure_time_us": 3000,
|
||||
"analogue_gain": 1.0,
|
||||
"colour_gains": null
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ class OakFcc3Manager:
|
|||
sync_mode="best",
|
||||
sync_tolerance_ms=12.0,
|
||||
buffer_size=8,
|
||||
only_camera=None
|
||||
):
|
||||
self.fps = fps
|
||||
self.width = width
|
||||
|
|
@ -28,6 +29,7 @@ class OakFcc3Manager:
|
|||
self.output_dtype = output_dtype
|
||||
self.capture_mode = capture_mode
|
||||
self.raw_policy = raw_policy
|
||||
self.only_camera = only_camera
|
||||
|
||||
self.roles = roles or {
|
||||
"CAM_A": "rgb",
|
||||
|
|
@ -97,11 +99,15 @@ class OakFcc3Manager:
|
|||
for f in features:
|
||||
socket = f.socket
|
||||
socket_name = socket.name
|
||||
if self.only_camera is not None and socket_name != self.only_camera:
|
||||
continue
|
||||
|
||||
role = self.roles.get(socket_name, "unknown")
|
||||
|
||||
print(f"[OAK] Criando câmera {socket_name} sensor={f.sensorName} role={role}")
|
||||
|
||||
cam = self.pipeline.create(dai.node.Camera).build(socket)
|
||||
self.apply_initial_camera_controls_to_node(cam, socket_name)
|
||||
ctrl_q = cam.inputControl.createInputQueue()
|
||||
|
||||
if self._is_preview_mode():
|
||||
|
|
@ -518,6 +524,19 @@ class OakFcc3Manager:
|
|||
|
||||
return result
|
||||
|
||||
def apply_initial_camera_controls_to_node(self, cam, cam_id):
|
||||
ctrl_state = self.camera_controls.get(cam_id, {})
|
||||
|
||||
ae = bool(ctrl_state.get("ae_enable", False))
|
||||
exp_us = int(ctrl_state.get("exposure_time_us") or 15000)
|
||||
gain = float(ctrl_state.get("analogue_gain") or 1.0)
|
||||
|
||||
if not ae:
|
||||
cam.initialControl.setManualExposure(
|
||||
exp_us,
|
||||
self._gain_to_iso(gain)
|
||||
)
|
||||
|
||||
def _send_control(self, cam_id, ctrl):
|
||||
if cam_id not in self.control_queues:
|
||||
raise RuntimeError(f"Fila de controle não existe para {cam_id}")
|
||||
|
|
|
|||
|
|
@ -889,6 +889,7 @@ def main():
|
|||
parser.add_argument("--mock_nir", default="", help="Imagem mock para role nir")
|
||||
parser.add_argument("--offline_sample_json", default="", help="JSON de sample salvo para análise offline")
|
||||
parser.add_argument("--offline_save_dir", default="calibration/offline_samples", help="Pasta para salvar frames brutos offline")
|
||||
parser.add_argument("--only_camera", default=None, choices=["CAM_A", "CAM_B", "CAM_C"])
|
||||
args = parser.parse_args()
|
||||
|
||||
cam = MultiSpectralClient(
|
||||
|
|
@ -901,7 +902,8 @@ def main():
|
|||
capture_mode=args.capture_mode,
|
||||
raw_policy=args.raw_policy,
|
||||
module_calibration_json=None,
|
||||
radiometric_enabled=True,
|
||||
radiometric_enabled=False,
|
||||
only_camera=args.only_camera,
|
||||
)
|
||||
|
||||
offline_mode = bool(args.offline_sample_json)
|
||||
|
|
|
|||
Loading…
Reference in New Issue