• Depthai_SDK, any way to output objects bbox absolute coordinates[x1,y1,x2,y2] ?

Hi there, I am a newbie, i am working on a quadcopter project, use Oak-1 Lite to capture the real time video, and run roboflow trained model by depthai_sdk, to autonomous control the drone to search , flight to and precision landing on special labeled target, I had read full DepthAI SDK Docs, Can't find any description or example to explain how to pull this bbox coordinates. only i can found the description about this coordinate is in OakCamera.visualize.visualizer.Visualizer portion. (page.36, chapter4. Visualizer)

Objects

• Detection:

{

"type": "detections",

"detections": {

"type": "array",

"items": {

"type": "object",

"bbox": {

"type": "array",

"items": {

"type": "number"

},

"description": "bbox absolute coordinates in format [x1, y1, x2, y2]"

},

"label": {

(

except this Json description, no other further explain how to get this coordinates output to a variable. please help . Thanks

    Hi JerryLiu
    Write it in a callback like:

    def cb(packet : DetectionPacket):
        for det in packet.img_detections.detections:
            print(det.label, det.xmax, det.xmin, det.ymax, det.ymin)

    Thanks,
    Jaka

    thanks Jaka, very helpful. please give me more instruction about how to calculate the distance between bbox center with frame center, i don't know how to get the frame center coordinates. i don't have very much coding experience , a lot question. : ) , thanks again.

      Hi JerryLiu
      Frame center would be (width/2, height/2).
      Bbox center would be (avg(xmin, xmax), avg(ymin, ymax)).

      For questions like these, you can use chatGPT.

      Thanks,
      Jaka