Body tracking pixel coordinate of keypoint problem

I am trying to draw a line behind the detected people by recording their previous positions using cv2. However, obj.keypoint_2d[27] pixel values ​​of the 27th point I got in this way are far away from the detected person.
As you can see here I am using 34 keypoint body format.

So the 27th key point you will see should be in the head. I should be able to put the point I want in these pixel values, but as you can see, it puts it at a very different point. And this is not a fixed difference. As the detected person moves, the distance may increase or decrease in x and y.

Hi @emrekocdemir

  • Do you observe this on other keypoints too?
  • Are you using mono or multicamera code?
  • Is it C++ or Python code?

Yes, all 2dkeypoints are not where they should be. I’m using mono svo. And using
this code.

Hi @emrekocdemir,

I think you’re not applying the image_scale to the keypoints, like it’s done in the viewer code.

Just do something like that in your main loop and it should work:

            # Update OCV view
            image_left_ocv = image.get_data()
            cv_viewer.render_2D(image_left_ocv,image_scale, bodies.body_list, body_param.enable_tracking, body_param.body_format)

            if len(bodies.body_list) > 0:
                for i in range(0, 33):
                    kpInfo = bodies.body_list[0].keypoint_2d[i] * image_scale
          , (int(kpInfo[0]), int(kpInfo[1])), radius=10, color=(0, 255, 0), thickness=-1)

            cv2.imshow("ZED | 2D View", image_left_ocv)
1 Like

Thank you really, I didn’t know this and I couldn’t see any document that I could access this way.

1 Like