Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offset in Y direction #106

Open
Gabriele-97 opened this issue May 16, 2023 · 0 comments
Open

Offset in Y direction #106

Gabriele-97 opened this issue May 16, 2023 · 0 comments

Comments

@Gabriele-97
Copy link

Thanks for this precious work!

I'm using this library to integrate the Azure Kinect in a robot system running in python.

I'm facing this issue: when extracting the 3D coordinates of the joints, there is a non-negiglible offset (up to 60cm) in the y coordinates of most joints (pelvis as well). X and Z positions are instead correct. Moreover, in the "combined image" the skeleton is perfectly aligned with the joints in any direction.
Has anyone noticed the same? Can you provide any reasonable explanation and suggestion for correction?
Thanks in advance!

The code I'm using is this one:

pykinect.initialize_libraries(track_body=True)
device_config = pykinect.default_configuration
device_config.color_resolution = pykinect.K4A_COLOR_RESOLUTION_OFF
device_config.depth_mode = pykinect.K4A_DEPTH_MODE_NFOV_UNBINNED

device = pykinect.start_device(config=device_config)
bodyTracker = pykinect.start_body_tracker()

cv2.namedWindow('Depth image with skeleton',cv2.WINDOW_NORMAL)
while True:
	capture = device.update()
	body_frame = bodyTracker.update()
	ret_depth, depth_color_image = capture.get_colored_depth_image()
	ret_color, body_image_color = body_frame.get_segmentation_image()

	if not ret_depth or not ret_color:
		continue

	for body_id in range(body_frame.get_num_bodies()):
		skeleton = body_frame.get_body(body_id).numpy()[:, :3]

		stampstring = str(time.time()) + " " +" ".join(str(r) for v in skeleton for r in v) + "\n"
		with open(filename,'a') as f:
			f.write(stampstring)

	combined_image = cv2.addWeighted(depth_color_image, 0.6, body_image_color, 0.4, 0)
	combined_image = body_frame.draw_bodies(combined_image)
	cv2.imshow('Depth image with skeleton',combined_image)

	if cv2.waitKey(1) == ord('q'):  
		break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant