hello,
I am working on an object localization project using Oak d Lite camera and a custom pre-trained model on Roboflow

the camera detects the object frame but it does not show the depth it always shows a depth equal to zero
Sometimes it shows numbers like 2022, 3125, and 2865 these constant numbers do not represent the correct depth
so what I need to know is how to get the right value of the depth and why if it showed a depth value it shows a constant number
thanks

Hi jakaskerl
do u know then how can i get the three coordinates from the SDK
after i detect the target i want to print the x and y coordinates and then calculate the depth

Thanks,
Mohamed

    MohamedMagdyGaberDarwish
    Add a callback function:

    with OakCamera() as oak:
        color = oak.create_camera('color', resolution="1080p")
        model_config = {
            'source': 'roboflow', # Specify that we are downloading the model from Roboflow
            'model':'american-sign-language-letters/6',
            'key':'coFlxareOlro' # Fake API key, replace with your own!
        }
    
        def cb(packet: DetectionPacket):
            detections = packet.detections
            for detection in detections:
                print(detection.top_left, detection.bottom_right)
    
    
        nn = oak.create_nn(model_config, color)
        oak.visualize(nn, fps=True)
        oak.callback(nn, cb)
        oak.start(blocking=True)

    Thanks,
    Jaka

      jakaskerl
      it worked when i forced it to work in USB2, I don't know really why it doesn't read that I am using USB3. The problem may be in my laptop
      Now I have another issue, I don't know what numbers the camera printing

      I want to print the middle coordinate of each object detected and then the depth so do you know how it can be done ?

      thanks

      Hi @MohamedMagdyGaberDarwish
      These are coordinates for bounding box (top_left and bottom_right). You can average the two and get the centerpoint.

      If you want depth as well, you need to create the model (create_nn) by passing spatial=True.

      Thanks,
      Jaka