aytek

  • Jul 19, 2024
  • Joined May 30, 2024
  • 0 best answers
  • Hello Luxonis Community,

    I hope you're all doing well. I've been exploring the capabilities of the OAK-D S2 PoE device and have found it incredibly useful in addressing various design challenges. Thank you for developing such a versatile tool.

    Currently, I'm focused on implementing 3D object detection, either on the host or on the device itself. Upon reviewing the example usages provided, I noticed a strong emphasis on 2D object detection on the image plane, with subsequent depth data registration to achieve 3D detection. However, I did not come across any examples specifically demonstrating single stage 3D object detection directly on point clouds or depth maps.

    Could someone please confirm if there are any such example usages available that I might have missed? Additionally, I would greatly appreciate any advice or recommendations regarding implementing single stage 3D object detection where the output is in real-world coordinates.

    Thank you in advance for your help. I'm looking forward to your insights.

    BR,

    • We have started with this example while saving the streams from OAK. which requires:

      opencv-python

      numpy

      depthai==2.17.0.0

      blobconverter>=1.2.8

      depthai-sdk==1.2.3

      I have verified that later versions of depthai-sdk does not have the problem of "parser inference". 🙂 Thanks again for making me realize the sdk version.

      I may kindly request that: there are lots of depthai-experiment, and most of them became either absolute or sdk version is troublesome, they might be updated.

    • Hi,

      To implement a software life-cycle and control the OAK device inside a docker container: We have written a wrapper around OAK-D device. Inside this wrapper, we use depthai-sdk. I'm trying to record the OAK-D-S2-PoE output stream using the Record class from depthai-sdk as:

      # Initialize the recording object with the specified save path and stream device

      self.recording = Record(self.oak_save_path, self.streamDevice)

      when I look at the class initilization of Record class I see:

      def __init__(self, path: Path, device: dai.Device, args: dict = None):

      Inside the init function: ArgsManager.parseArgs() is called since args is None
      if args is None:

      args = ArgsManager.parseArgs()

      When I look at the inside ArgsManager.parseArgs() function itself, I see:

      def parseArgs(parser: argparse.ArgumentParser = None):

      …

      if parser is None:

      parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter)

      …

      This parser interfere with the original wrapper class parser. Which creates the below error on Record class initilization:

      python3 app.py --env local -or or1 --stream_name oak1

      the terminal output:

      [2024-06-25 20:09:35.404] [depthai] [warning] [18443010A18E970F00] [192.168.0.107] Flashed bootloader version 0.0.22, less than 0.0.28 is susceptible to bootup/restart failure. Upgrading is advised, flashing main/factory (not user) bootloader. Available: 0.0.28

      usage: app.py [-h] [-cam {left,right,color}] [-vid VIDEO] [-dd] [-dnn] [-cnnp CNNPATH] [-cnn CNNMODEL] [-sh SHAVES] [-cnnsize CNNINPUTSIZE]

      [-rgbr RGBRESOLUTION] [-rgbf RGBFPS] [-monor MONORESOLUTION] [-monof MONOFPS] [-fps FPS] [-dct DISPARITYCONFIDENCETHRESHOLD]

      [-lrct LRCTHRESHOLD] [-sig SIGMA] [-med {0,3,5,7}] [-dlrc] [-ext] [-sub]

      [-cm {AUTUMN,BONE,CIVIDIS,COOL,DEEPGREEN,HOT,HSV,INFERNO,JET,MAGMA,OCEAN,PARULA,PINK,PLASMA,RAINBOW,SPRING,SUMMER,TURBO,TWILIGHT,TWILIGHT_SHIFTED,VIRIDIS,WINTER}]

      [-maxd MAXDEPTH] [-mind MINDEPTH] [-sbb] [-sbbsf SBBSCALEFACTOR]

      [-s {nnInput,color,left,right,depth,depthRaw,disparity,disparityColor,rectifiedLeft,rectifiedRight} [{nnInput,color,left,right,depth,depthRaw,disparity,disparityColor,rectifiedLeft,rectifiedRight} ...]]

      [-dff] [--report {temp,cpu,memory} [{temp,cpu,memory} ...]] [--reportFile REPORTFILE] [-cb CALLBACK]

      [--openvinoVersion {2020_3,2020_4,2021_1,2021_2,2021_3,2021_4,2022_1,UNIVERSAL}] [--count COUNTLABEL] [-dev DEVICEID]

      [-bandw {auto,low,high}] [-gt {auto,qt,cv}] [-usbs {usb2,usb3}] [-enc ENCODE [ENCODE ...]] [-encout ENCODEOUTPUT] [-xls XLINKCHUNKSIZE]

      [-poeq POEQUALITY] [-camo CAMERAORIENTATION [CAMERAORIENTATION ...]] [--cameraControls]

      [--cameraExposure CAMERAEXPOSURE [CAMERAEXPOSURE ...]] [--cameraSensitivity CAMERASENSITIVITY [CAMERASENSITIVITY ...]]

      [--cameraSaturation CAMERASATURATION [CAMERASATURATION ...]] [--cameraContrast CAMERACONTRAST [CAMERACONTRAST ...]]

      [--cameraBrightness CAMERABRIGHTNESS [CAMERABRIGHTNESS ...]] [--cameraSharpness CAMERASHARPNESS [CAMERASHARPNESS ...]]

      [--irDotBrightness IRDOTBRIGHTNESS] [--irFloodBrightness IRFLOODBRIGHTNESS] [--skipVersionCheck] [--noSupervisor] [--sync]

      [--noRgbDepthAlign] [--debug] [-app {uvc,record}] [-tun CAMERATUNING]

      app.py: error: unrecognized arguments: --env local -or or1 --stream_name oak1

      For a better visulazation of the error I add the SS of the error here.

      But there is already these arguments inside app.py .

      if __name__ == "__main__":

      import argparse

      parser = argparse.ArgumentParser()

      parser.add_argument("-e", "--environment", type=str)

      parser.add_argument("-or", "--operating_room", type=str)

      parser.add_argument("-sn", "--stream_name", type=str)

      args = parser.parse_args()

      I understand your intention is to start the recording with default parameters or take input arguments. But current ArgsManager.parseArgs()implementation creates problem due to parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter)line.

      Is there a known solution for this problem? Or is changing the way Record class takes input arguments an option for sdk design?

      Details are as follows:

      Device: OAK-D S2 PoE

      depthai versions are:

      pip list| grep depthai

      depthai 2.26.0.0

      depthai-pipeline-graph 0.0.5

      depthai-sdk 1.2.3

      • O great! It solved my problem.

      • Hi folks,
        I have a question regarding the below situation:

        I have manipulated the deptai-experiment poe-tcp-streaming example.

        Here is pipeline details:

        cam_rgb = pipeline.createColorCamera()

        cam_rgb.setIspScale(2, 3)

        self.fps = cam_rgb.getFps()

        self.height = cam_rgb.getResolutionHeight()

        self.width = cam_rgb.getResolutionWidth()

        self.logger.info("[{}] OAK Side -> Fps: {}, width: {} height: {}".format(self.name,self.fps,self.width,self.height))

        when I created the above pipeline, I get the below log:

        [oak] OAK Side -> Fps: 30.0, width: 1920 height: 1080

        But I would expect to see scaled width and height values. Is it expected behaviour or a bug?

        On host side when I control the incoming frame in a while loop by:

        frame = self._read_stream()

        frame_height, frame_width, _ = frame.shape

        self.logger.info("[{}] Host Side -> Fps: {}, width: {} height: {}".format(self.name,self.fps,frame_width,frame_height))

        I see the below log as expected:

        [oak] Host Side -> Fps: 30.0, width: 1280 height: 720

        To repeat my quesiton, is this an expected behavior or a bug?

        • Hi @aytek
          Use

          print(camRgb.getIspWidth())
          print(camRgb.getIspHeight())

          the resolution refers to the sensor resolution set and is read before going through ISP.

          Thanks,
          Jaka