Hello,
I was looking for assistance with modifying currently functional OAK-D-S2 code to OAK-D-PoE code. Here are the changes made so far, but are there further changes that should be made to connect all the nodes and make sure the pipeline will launch correctly? Relevant portion below:
FRAME_SIZE = (1440,1080)
FOCUS_VALUE = 175
FPS = 30
BBOX_EXPANSION_PERCENT = 200
DETECTION_THRESHOLD = 0.9
MANUAL_EXPOSURE = True
EXP_TIME = 1000 # sensor exposure time, range 1 to 33000
SENS_ISO = 1600 # sesnor sensitivity, range 100 to 1600
# Create pipeline
pipeline = dai.Pipeline()
# Create an OAK-1-PoE camera
cam = pipeline.create(dai.node.CameraBoard, dai.CameraBoard.OAK1_POE)
# Define camera node
cam = pipeline.create(dai.node.ColorCamera)
cam.setResolution(dai.ColorCameraProperties.SensorResolution.THE_1080_P)
cam.setPreviewSize(FRAME_SIZE)
cam.setInterleaved(False)
cam.initialControl.setManualFocus(FOCUS_VALUE)
cam.setFps(FPS)
# Define image preprocessor node
# --> dection model requires 384x384, grayscale input image
proc = pipeline.create(dai.node.ImageManip)
proc.initialConfig.setResize(384,384)
proc.initialConfig.setFrameType(dai.ImgFrame.Type.GRAY8)
proc.initialConfig.setKeepAspectRatio(False)
# Define QR detection model
nn = pipeline.create(dai.node.MobileNetDetectionNetwork)
nn.setConfidenceThreshold(DETECTION_THRESHOLD)
nn.setBlobPath(blobconverter.from_zoo(name="qr_code_detection_384x384", zoo_type="depthai", shaves=6))
nn.input.setQueueSize(1)
nn.input.setBlocking(False)
# Define input nodes
controlIn = pipeline.create(dai.node.XLinkIn)
controlIn.setStreamName("control")
# Define output nodes
camOut = pipeline.create(dai.node.XLinkOut)
camOut.setStreamName("camera")
nnOut = pipeline.create(dai.node.XLinkOut)
nnOut.setStreamName("nn")
# Link the nodes
cam.preview.link(proc.inputImage)
proc.out.link(nn.input)
cam.preview.link(camOut.input)
nn.out.link(nnOut.input)
controlIn.out.link(cam.inputControl)
# Connect to a device and start the pipeline
with dai.Device(pipeline) as device: .. and business logic continues, having launched pipeline