OpenKinect / libfreenect

Drivers and libraries for the Xbox Kinect device on Windows, Linux, and OS X
http://openkinect.org
3.55k stars 1.15k forks source link

Allow to perform registration while keeping the depth buffer #649

Open SirLynix opened 2 years ago

SirLynix commented 2 years ago

Hi, author of obs-kinect here.

First of all, thank you for your amazing job on libfreenect, I've been using it for my plugin but there's one issue that remains, I need to be able to get registered depth (color-mapped depth as I call it) and regular depth at the same time, however libfreenect seems to be the only kinect backend which doesn't provide a function to map depth to rgb space (libfreenect2 has Registration::apply, Kinect SDKs have MapColorFrameToDepthFrame, Azure SDK has k4a_transformation_depth_image_to_color_camera).

I see there's the internal freenect_apply_depth_to_mm which seems to do what I want, is there a way it could be exposed?

Thank you.

piedar commented 2 years ago

I think you might want freenect_apply_registration because it aligns the result to the RGB image, while freenect_apply_depth_to_mm converts to mm but does not align.

SirLynix commented 2 years ago

Yes indeed. I made a fork of libfreeenect to expose such features which allowed me to have both depth and color-mapped depth images.

piedar commented 2 years ago

Nice! I had a quick go at it the other day. It's a bit more complicated, but I kept convert_packed_to_16bit internal and my registration function handles all the depth modes rather than just FREENECT_DEPTH_11BIT. Let me know what you think.

SirLynix commented 2 years ago

Looks good! I will give it a try to check if it works as expected soon, thank you!

edugimeno commented 2 years ago

Please please forgive me for hijacking this thread for this question, but there's absolutely no place / forum I can find to place a couple questions about this project. The wiki links to google groups which were closed 4 years ago. There's no other trace of forum for OpenKinect, can you please help me with directions for any currently working forum for OpenKinect / Libfreenect?

Thanks in advance and sorry

piedar commented 1 year ago

@edugimeno Alas, there isn't really a forum that I know of. I check in here on GitHub occasionally to fix bugs and give suggestions, but most contributors have moved on to other projects.