• DepthAI-v2
  • [critical] Fatal error. Please report to developers. Log: 'ResourceLocker' '358'

Hi

I'm trying to use imagemanip on a still frame from a camera. The intent is to feed the still frame to a neural net rather than the preview or video streams (which won't have the same data due to cropping). I'm creating a very simple pipeline as shown below (code is below picture). Without an imagemanip node I get the image out just fine. When I do use the imagemanip node and send a trigger I get the error

[14442C10E134C8D600] [1.2] [21.756] [system] [critical] Fatal error. Please report to developers. Log: 'ResourceLocker' '358'```

#!/usr/local/bin/python3
import cv2  # opencv - display the video stream
import depthai  # depthai - access the camera and its data packets
import time
import numpy as np
import json

dai = depthai

pipeline = depthai.Pipeline()

cam_rgb = pipeline.create(depthai.node.ColorCamera)
cam_rgb.setPreviewSize(100, 100)
cam_rgb.setInterleaved(False)
cam_rgb.setBoardSocket(depthai.CameraBoardSocket.CAM_A) # Same as CameraBoardSocket.RGB

manip = pipeline.create(dai.node.ImageManip)
manip.initialConfig.setResize(640, 480)
manip.initialConfig.setFrameType(dai.RawImgFrame.Type.BGR888p)


cam_rgb.setResolution(depthai.ColorCameraProperties.SensorResolution.THE_4000X3000)
cam_rgb.initialControl.setAutoFocusMode(depthai.RawCameraControl.AutoFocusMode.CONTINUOUS_VIDEO)
cam_rgb.initialControl.setAutoFocusTrigger()


trigger_in = pipeline.create(depthai.node.XLinkIn)
trigger_in.setStreamName("trigger")
trigger_in.out.link(cam_rgb.inputControl)

cam_rgb.still.link(manip.inputImage)

xout_preview = pipeline.create(depthai.node.XLinkOut)
xout_preview.setStreamName("preview")

manip.out.link(xout_preview.input)

with depthai.Device(pipeline) as device:
    device.setLogLevel(dai.LogLevel.DEBUG)
    device.setLogOutputLevel(dai.LogLevel.DEBUG)
    with open("/code/tmp/pipeline.json", "w") as ff:
        ff.write(json.dumps(pipeline.serializeToJson()))

    q_preview = device.getOutputQueue("preview", maxSize=1, blocking=False)
    q_trigg = device.getInputQueue("trigger")

    while True:
        x = input("Do trigger?")
        start = time.time()
        ctrl = depthai.CameraControl()
        ctrl.setCaptureStill(True)

        print(f"Starting to send trigger request at {time.time() - start} seconds")
        q_trigg.send(ctrl)

        print(f"Sent trigger request at {time.time() - start} seconds")

        
        in_rgb = q_preview.get()

    jakaskerl using a lower resolution defeats the purpose. I need to run this at 4k (actually I need to run this at 32MP). What's the root cause here? Is there not enough ram to do the resizing operation?

      JariullahSafi
      THE_4000X3000 should be lower res than THE_12_MP.

      Yep, it's RAM.
      You can try tweaking these

         /**
           * SIPP (Signal Image Processing Pipeline) internal memory pool.
           * SIPP is a framework used to schedule HW filters, e.g. ISP, Warp, Median filter etc.
           * Changing the size of this pool is meant for advanced use cases, pushing the limits of the HW.
           * By default memory is allocated in high speed CMX memory. Setting to 0 will allocate in DDR 256 kilobytes.
           * Units are bytes.
           */
          void setSippBufferSize(int sizeBytes) {
              impl()->setSippBufferSize(sizeBytes);
          }
      
          /**
           * SIPP (Signal Image Processing Pipeline) internal DMA memory pool.
           * SIPP is a framework used to schedule HW filters, e.g. ISP, Warp, Median filter etc.
           * Changing the size of this pool is meant for advanced use cases, pushing the limits of the HW.
           * Memory is allocated in high speed CMX memory
           * Units are bytes.
           */
          void setSippDmaBufferSize(int sizeBytes) {
              impl()->setSippDmaBufferSize(sizeBytes);
          }

      Thanks,
      Jaka

        jakaskerl I see. I assume this will require me to recompile depthai?

        I will test this at some point. For now I've built a flow where I'm transferring the still to the host, resizing it, and then sending it back to the camera to run the neural nets.