fix stereo filters

This commit is contained in:
Cyrille Nofficial 2024-01-28 17:51:14 +01:00
parent 69b4e28323
commit 01e2c8ce16
2 changed files with 8 additions and 8 deletions

View File

@ -251,7 +251,7 @@ def execute_from_command_line() -> None:
extended_disparity=args.stereo_mode_extended_disparity, extended_disparity=args.stereo_mode_extended_disparity,
subpixel=args.stereo_mode_subpixel, subpixel=args.stereo_mode_subpixel,
lr_check=args.stereo_mode_lr_check, lr_check=args.stereo_mode_lr_check,
*stereo_filters), stereo_filters=stereo_filters),
disparity_processor=disparity_processor) disparity_processor=disparity_processor)
def sigterm_handler(signum: int, frame: typing.Optional[ def sigterm_handler(signum: int, frame: typing.Optional[

View File

@ -6,8 +6,8 @@ import datetime
import logging import logging
import pathlib import pathlib
import time import time
import typing
from dataclasses import dataclass from dataclasses import dataclass
from typing import List, Any
import cv2 import cv2
import depthai as dai import depthai as dai
@ -97,7 +97,7 @@ class FrameProcessor:
self._mqtt_client = mqtt_client self._mqtt_client = mqtt_client
self._frame_topic = frame_topic self._frame_topic = frame_topic
def process(self, img: dai.ImgFrame) -> typing.Any: def process(self, img: dai.ImgFrame) -> Any:
""" """
Publish camera frames Publish camera frames
:param img: image read from camera :param img: image read from camera
@ -421,7 +421,7 @@ class DepthSource(Source):
extended_disparity: bool = False, extended_disparity: bool = False,
subpixel: bool = False, subpixel: bool = False,
lr_check: bool = True, lr_check: bool = True,
*filters: StereoDepthPostFilter stereo_filters: List[StereoDepthPostFilter] = []
) -> None: ) -> None:
""" """
# Closer-in minimum depth, disparity range is doubled (from 95 to 190): # Closer-in minimum depth, disparity range is doubled (from 95 to 190):
@ -456,10 +456,10 @@ class DepthSource(Source):
self._depth.setSubpixel(subpixel) self._depth.setSubpixel(subpixel)
self._depth.disparity.link(self._xout_disparity.input) self._depth.disparity.link(self._xout_disparity.input)
if len(filters) > 0: if len(stereo_filters) > 0:
# Configure post-processing filters # Configure post-processing filters
config = self._depth.initialConfig.get() config = self._depth.initialConfig.get()
for filter in filters: for filter in stereo_filters:
filter.apply(config) filter.apply(config)
self._depth.initialConfig.set(config) self._depth.initialConfig.set(config)
@ -509,8 +509,8 @@ class MqttSource(Source):
@staticmethod @staticmethod
# pylint: disable=unused-argument # pylint: disable=unused-argument
def _on_connect(client: mqtt.Client, userdata: MqttConfig, flags: typing.Any, def _on_connect(client: mqtt.Client, userdata: MqttConfig, flags: Any,
result_connection: typing.Any) -> None: result_connection: Any) -> None:
# if we lose the connection and reconnect then subscriptions will be renewed. # if we lose the connection and reconnect then subscriptions will be renewed.
client.subscribe(topic=userdata.topic, qos=userdata.qos) client.subscribe(topic=userdata.topic, qos=userdata.qos)