Hey,

I tried to capture rgb-images in THE_4_K with my OAK-D-PoE and this seems to work very well if exposure time is on auto-mode. But if I set a manual exposure time by:

camRgb.initialControl.setManualExposure(exposureTimeUs=300, sensitivityIso=800)

the camera lowers the resolution to 1280x720 px. Does anyone know this problem and maybe how to solve it?

I am using ISP-node for image capturing.

I appreciate any help

    Hi domgs
    Could you add a MRE. I tried setting exposure locally but nothing changed for me.

    Thanks,
    Jaka

    Hey thanks for your reply @jakaskerl ,

    well thats not so easy, because I sourced it out. But maybe a piece of my Pipeline function is enough to find the problem:

    PIPE_SPEC = {

        "monoRes": dai.MonoCameraProperties.SensorResolution.THE_800_P,

        "rgbRes": dai.ColorCameraProperties.SensorResolution.THE_4_K,

        "median_kernel": dai.MedianFilter.MEDIAN_OFF,

        "fps": 30,

        "rgb_iso": 800,

        "rgb_exp": 200,

        "mono_iso": "auto"

        "mono_exp": "auto"

    }

    def define_pipeline(device: dai.Device, streams: list, **kwargs):

    `pipeline = dai.Pipeline() # Initialsieren der Pipeline`

    for key, value in kwargs.items():

    PIPE_SPEC[key] = value

    if "rgb" in streams:

    camRgb = pipeline.create(dai.node.ColorCamera)

    xoutRgb = pipeline.create(dai.node.XLinkOut)

    xoutRgb.setStreamName("rgb")

    # Properties for RGB

    camRgb.setBoardSocket(dai.CameraBoardSocket.RGB)

    camRgb.setResolution(PIPE_SPEC["rgbRes"])

    camRgb.setIspScale(2,3)

    #camRgb.setPreviewSize(1280,800)

    camRgb.setInterleaved(False)

    camRgb.setColorOrder(dai.ColorCameraProperties.ColorOrder.RGB)

    camRgb.setFps(PIPE_SPEC["fps"])

    if isinstance(PIPE_SPEC["rgb_exp"], int):

    camRgb.initialControl.setManualExposure(exposureTimeUs=PIPE_SPEC["rgb_exp"],

    sensitivityIso=PIPE_SPEC["rgb_iso"])

    # Linking

    camRgb.isp.link(xoutRgb.input)

    monoLeft = pipeline.create(dai.node.MonoCamera)

    monoRight = pipeline.create(dai.node.MonoCamera)

    # Properties for Mono left

    monoLeft.setResolution(PIPE_SPEC["monoRes"])

    monoLeft.setBoardSocket(dai.CameraBoardSocket.LEFT)

    # Properties for Mono right

    monoRight.setResolution(PIPE_SPEC["monoRes"])

    monoRight.setBoardSocket(dai.CameraBoardSocket.RIGHT)

    h = monoRight.getResolutionHeight()

    w = monoRight.getResolutionWidth()

    if "monoL" in streams:

    xoutMonoL = pipeline.create(dai.node.XLinkOut)

    xoutMonoL.setStreamName("monoL")

    monoLeft.setFps(PIPE_SPEC["fps"])

    if isinstance(PIPE_SPEC["mono_exp"], int):

    monoLeft.initialControl.setManualExposure(exposureTimeUs=PIPE_SPEC["mono_exp"],

    sensitivityIso=PIPE_SPEC["mono_iso"])

    # Linking

    monoLeft.out.link(xoutMonoL.input)

    if "monoR" in streams:

    xoutMonoR = pipeline.create(dai.node.XLinkOut)

    xoutMonoR.setStreamName("monoR")

    monoRight.setFps(PIPE_SPEC["fps"])

    if isinstance(PIPE_SPEC["mono_exp"], int):

    monoRight.initialControl.setManualExposure(exposureTimeUs=PIPE_SPEC["mono_exp"],

    sensitivityIso=PIPE_SPEC["mono_iso"])

    # Linking

    monoRight.out.link(xoutMonoR.input)

    # Power Laser Dot Projector

    device.setIrLaserDotProjectorBrightness(1200)

    return pipeline, h, w

    I hope this helps

      Hi domgs
      Below script does not change the resolution when changing RGB exposure:

      import depthai as dai
      import cv2
      
      PIPE_SPEC = {
          "monoRes": dai.MonoCameraProperties.SensorResolution.THE_800_P,
          "rgbRes": dai.ColorCameraProperties.SensorResolution.THE_4_K,
          "median_kernel": dai.MedianFilter.MEDIAN_OFF,
          "fps": 30,
          "rgb_iso": 800,
          "rgb_exp": 500,
          "mono_iso": "auto",
          "mono_exp": "auto"
      }
      
      def define_pipeline(device: dai.Device, streams: list, **kwargs):
          pipeline = dai.Pipeline()  # Initialsieren der Pipeline`
          for key, value in kwargs.items():
              PIPE_SPEC[key] = value
          if "rgb" in streams:
              camRgb = pipeline.create(dai.node.ColorCamera)
              xoutRgb = pipeline.create(dai.node.XLinkOut)
              xoutRgb.setStreamName("rgb")
              # Properties for RGB
              camRgb.setBoardSocket(dai.CameraBoardSocket.RGB)
              camRgb.setResolution(PIPE_SPEC["rgbRes"])
              # camRgb.setPreviewSize(1280,800)
              camRgb.setInterleaved(False)
              camRgb.setColorOrder(dai.ColorCameraProperties.ColorOrder.RGB)
              camRgb.setFps(PIPE_SPEC["fps"])
              if isinstance(PIPE_SPEC["rgb_exp"], int):
                  camRgb.initialControl.setManualExposure(exposureTimeUs=PIPE_SPEC["rgb_exp"],
                                                          sensitivityIso=PIPE_SPEC["rgb_iso"])
          # Linking
          camRgb.isp.link(xoutRgb.input)
          monoLeft = pipeline.create(dai.node.MonoCamera)
          monoRight = pipeline.create(dai.node.MonoCamera)
          # Properties for Mono left
          monoLeft.setResolution(PIPE_SPEC["monoRes"])
          monoLeft.setBoardSocket(dai.CameraBoardSocket.LEFT)
          # Properties for Mono right
          monoRight.setResolution(PIPE_SPEC["monoRes"])
          monoRight.setBoardSocket(dai.CameraBoardSocket.RIGHT)
          h = monoRight.getResolutionHeight()
          w = monoRight.getResolutionWidth()
          if "monoL" in streams:
              xoutMonoL = pipeline.create(dai.node.XLinkOut)
              xoutMonoL.setStreamName("monoL")
              monoLeft.setFps(PIPE_SPEC["fps"])
              if isinstance(PIPE_SPEC["mono_exp"], int):
                  monoLeft.initialControl.setManualExposure(exposureTimeUs=PIPE_SPEC["mono_exp"],
                                                            sensitivityIso=PIPE_SPEC["mono_iso"])
              # Linking
              monoLeft.out.link(xoutMonoL.input)
          if "monoR" in streams:
              xoutMonoR = pipeline.create(dai.node.XLinkOut)
              xoutMonoR.setStreamName("monoR")
              monoRight.setFps(PIPE_SPEC["fps"])
              if isinstance(PIPE_SPEC["mono_exp"], int):
                  monoRight.initialControl.setManualExposure(exposureTimeUs=PIPE_SPEC["mono_exp"],
                                                             sensitivityIso=PIPE_SPEC["mono_iso"])
              # Linking
              monoRight.out.link(xoutMonoR.input)
          # Power Laser Dot Projector
          device.setIrLaserDotProjectorBrightness(1200)
          return pipeline, h, w
      
      def main():
          device = dai.Device()
          pipeline, h, w = define_pipeline(device, [
                                           "rgb", "monoL", "monoR"], fps=30, rgb_iso=800, rgb_exp=300, mono_iso=800, mono_exp=200)
          device.startPipeline(pipeline)
          rgbQueue = device.getOutputQueue(name="rgb", maxSize=4, blocking=False)
          monoLQueue = device.getOutputQueue(name="monoL", maxSize=4, blocking=False)
          monoRQueue = device.getOutputQueue(name="monoR", maxSize=4, blocking=False)
          while True:
              inRgb = rgbQueue.get()
              inMonoL = monoLQueue.get()
              inMonoR = monoRQueue.get()
              cv2.imshow("rgb", inRgb.getCvFrame())
              cv2.imshow("monoL", inMonoL.getCvFrame())
              cv2.imshow("monoR", inMonoR.getCvFrame())
              # print all frame sizes
              print("rgb: ", inRgb.getCvFrame().shape)
              print("monoL: ", inMonoL.getCvFrame().shape)
              print("monoR: ", inMonoR.getCvFrame().shape)
              if cv2.waitKey(1) == ord('q'):
                  break
          cv2.destroyAllWindows()
      
      if __name__ == "__main__":
          main()

      Thanks,
      Jaka

        jakaskerl

        Hey,

        thanks for your help. So it seems that the pipeline should already work fine right?

        I'll search for the problem in the rest of my code and give a reply, if I found it.