Draw joint orientations using OpenCV

Hi @thanhlh

Unfortunately PyNuitrack doesn’t provide convertRealToProjCoord yet. But you can write your own convert function like this:

def convertRealToProjCoord(x, y, z, width, height, hfov):
	cX = width / 2
	cY = height / 2
	fX = cX / tan(hfov / 2)
	fY = fX
	
	x = cX + fX * x / z;
	y = cY - fY * y / z;
	z = z;
	
	return x, y, z

Where:
width, height - resolution of the image provided by DepthSensor
hfov - Horizontal field of view in radians of your depth sensor

Regarding “show” and “length”:
show - image where you want to draw joint orientations
length - just the length of axles. you can experiment with this variable to choose the length of the axles according to your needs

1 Like