Messages
Messages entry. You can click on them to find out more.Creating a message in Script node
cam.inputControl).Python
1script = pipeline.create(dai.node.Script)
2script.setScript("""
3 # Create a message
4 ctrl = CameraControl(1)
5 # Configure the message
6 ctrl.setCaptureStill(True)
7 # Send the message from the Script node
8 node.io['out'].send(ctrl)
9""")Creating a message on the Host
Python
1# Create XLinkIn node and configure it
2xin = pipeline.create(dai.node.XLinkIn)
3xin.setStreamName("frameIn")
4xin.out.link(nn.input) # Connect it to NeuralNetwork's input
5
6with dai.Device(pipeline) as device:
7 # Create input queue, which allows you to send messages to the device
8 qIn = device.getInputQueue("frameIn")
9 # Create ImgFrame message
10 img = dai.ImgFrame()
11 img.setData(frame)
12 img.setWidth(300)
13 img.setHeight(300)
14 qIn.send(img) # Send the message to the device