luxonis / depthai-python

DepthAI Python Library
MIT License
353 stars 192 forks source link

Capturing still via host does not work with OAK-D POE #1075

Open martonmiklos opened 4 days ago

martonmiklos commented 4 days ago

I have a OAK-D POE from what I would like to capture depth and RGB images triggered remotely.

I tried to use the rgb_camera_control.py example but regardless if I press C key the still queue will never be non empty here: https://github.com/luxonis/depthai-python/blob/main/examples/ColorCamera/rgb_camera_control.py#L152

I have increased the debug log with DEPTHAI_LEVEL=trace python rgb_camera_control.py and I see that the control command got sent:

[2024-09-25 21:32:10.646] [depthai] [trace] Sending message to device (control) - serialize time: 14µs, data size: 0, object type: 5 object data: 
0000: b9 1f 08 03 00 88 00 00 00 00 00 00 b9 03 00 00 00 b9 05 00 00 00 00 00 b9 05 00 00 00 00 00 00
0020: 00 00 00 00 00 00 00 00 b9 03 00 00 00 b9 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[19443010219A6F1300] [192.168.1.197] [1727292730.710] [host] [trace] Log vector decoded, size: 12
[19443010219A6F1300] [192.168.1.197] [28.690] [system] [trace] EV:1,S:0,IDS:3,IDD:0,TSS:28,TSN:690637588
[19443010219A6F1300] [192.168.1.197] [28.690] [system] [trace] EV:1,S:1,IDS:3,IDD:0,TSS:28,TSN:690752041

Sending other commands like camera focus works the same manner via the CameraControl:

            ctrl = dai.CameraControl()
            ctrl.setManualFocus(lensPos)
            controlQueue.send(ctrl)

so I do not think it is a network issue.

In my final phase of my depression I tried to add a script which does the same by:

# Script node
script = pipeline.create(dai.node.Script)
script.setScript('''
    import time
    ctrl = CameraControl()
    ctrl.setCaptureStill(True)
    while True:
        node.io['out'].send(ctrl)
        time.sleep(1)
''')
# Connections: Linking camera to XLink input, so that the frames will be sent to host
script.outputs['out'].link(camRgb.inputControl)

and I get still images fine.

Erol444 commented 3 days ago

@martonmiklos so when clicking C key, a frame doesn't open up on the screen with the still image? What depthai library version are you using?

martonmiklos commented 3 days ago

@martonmiklos so when clicking C key, a frame doesn't open up on the screen with the still image?

Yes exactly. I have added some print-s to indicate that stills in the queue but never got triggered

What depthai library version are you using?

From the depthai-python I checked out the latest master: 38e064da1eb57eb7e90c80c15efd0ca4345933e9

Now as you mentioned it I checked out the 2.28.0 but the situation is the same.

Erol444 commented 3 days ago

@martonmiklos how about opencv version? Does controlQueue.send(ctrl) actually get executed, and there's really no output from the still queue? And normal video stream is working as expected?

martonmiklos commented 3 days ago

And normal video stream is working as expected?

Video and preview works ok.

Does controlQueue.send(ctrl) actually get executed, and there's really no output from the still queue?

As I mentioned above if I increase the trace level it is visible that it got sent out. Other type of controlQueue sends (like manual focus) functioning fine.

how about opencv version?

OpenCV Version: 4.5.4