jakaskerl
jakaskerl
Hi
I meant the delay of NN detection box drawing over camera stream. the box stuck pointing the place where the detected object was before when camera was moved. delay before reaction was 0.3-0.5s seemingly. Previously (before I synced imu and video) video -> nn -> cv2 behavior was different.
`# Create pipeline
pipeline = dai.Pipeline()
cam = pipeline.create(dai.node.ColorCamera)
cam.setPreviewSize(VIDEO_WIDTH, VIDEO_HEIGHT)
cam.setInterleaved(False)
fps = 25
cam.setFps(fps)
cam.setResolution(dai.ColorCameraProperties.SensorResolution.THE_1080_P)
cam.setColorOrder(dai.ColorCameraProperties.ColorOrder.RGB)
xout_cam = pipeline.create(dai.node.XLinkOut)
xout_cam.setStreamName("video")
detector = pipeline.create(dai.node.YoloDetectionNetwork)
detector.setConfidenceThreshold(prob_lim)
detector.setNumClasses(2)
detector.setCoordinateSize(4)
detector.setAnchors([])
detector.setAnchorMasks({})
detector.setIouThreshold(0.7)
detector.setBlobPath(nnPathDefault)
detector.setNumInferenceThreads(1)
detector.input.setBlocking(False)
xout_nn = pipeline.create(dai.node.XLinkOut)
xout_nn.setStreamName("nn")
imu = pipeline.create(dai.node.IMU)
xoutImu = pipeline.create(dai.node.XLinkOut)
xoutImu.setStreamName("imu")
xoutGrp = pipeline.create(dai.node.XLinkOut)
xoutGrp.setStreamName("xout")
imu.enableIMUSensor(dai.IMUSensor.ROTATION_VECTOR, 400)
imu.setBatchReportThreshold(1)
imu.setMaxBatchReports(10)
sync = pipeline.create(dai.node.Sync)
sync.setSyncThreshold(timedelta(milliseconds=20))
sync.setSyncAttempts(-1)
cam.preview.link(sync.inputs["video"])
imu.out.link(sync.inputs["imu"])
sync.out.link(xoutGrp.input)
cam.preview.link(detector.input)
detector.passthrough.link(sync.inputs["video"])
detector.out.link(xout_nn.input)`
thanks
Yury