Items with no label
3335 Discussions

How to compute object's height for D435?

RSun9
New Contributor I
13,823 Views

Hi there,

I am trying to convert an object's height in pixels to its actual height in meters. The equation I use is simple geometry. See the diagram below. PH = (D * bh)/f, where PH is the object height I want to measure, D is the measured distance (in meters) between the object and the camera, bh is the object's height in pixels, and f is the focal length.

I know that D is accurate (checked against the ground truth); bh is accurate (visually checked on display); f is generated by the SDK API ('intrinsic.fx' or 'intrinsic.fy'). At resolution 848x480, f is reported to be 423.499. Note f is obtained from the depth frame, as shown in the wiki API how-to ( https://github.com/IntelRealSense/librealsense/wiki/API-How-To).

However, when I apply the numbers into the equation, the height is way off. For example, for a person standing 3.4 meters away from the camera, the height in pixels is 334, and the computed height is 2.68 meters. His actual height is about 1.68 meters.

Why is this happening? Is this a calibration issue? Does my equation not fit D435's optical model?

BTW, the same equation works very well for D415.

Thanks,

Robby

0 Kudos
21 Replies
idata
Employee
708 Views

Hi @Robby_S,

 

 

Have you looked at the rs-measure example in the librealsense source code? It shows exactly how to calculate the distance between two points.

 

 

Regards,

 

Jesus G.

 

Intel Customer Support
0 Kudos
Reply