簡體   English   中英

Kinect v2,從色框到相機空間的映射

[英]Kinect v2, mapping from color frame to camera space

我在1920 * 1080彩色幀中有一個像素,我需要知道它在相機空間中的位置(以米為單位)。 我知道我應該使用CoordinateMapper類,但是此處記錄的CoordinateMapper.MapColorFrameToCameraSpace方法將深度框用作輸入。 我很困惑:輸入不應該是彩色框嗎? 我畢竟想在彩色框和相機空間之間映射。

我認為有些事情令我望而卻步,如果有人能說清楚,我將不勝感激。 謝謝!

這更多的是評論,而不是答案(但我沒有代表要評論):

我相信它需要深度框而不是彩色框的原因是相機空間是三維的,因此它無法僅從2D像素位置得知-它需要深度。

檢查一下...此代碼是我為萬聖節構建的。 它演示了您想要的東西。 代碼中的注釋也有幫助。

http://github.com/IntStarFoo/KinectAStare

http://github.com/IntStarFoo/KinectAStare/blob/master/ViewModels/KinectBaseViewModel.cs

                    TrackedHead = body.Joints[JointType.Head].Position;
                    //This is an 'aproxometery'  http://trailerpark.wikia.com/wiki/Rickyisms
                    //  of the tracking direction to be applied to the eyeballs on 
                    //  the screen.
                    TrackedHeadX = (int)(TrackedHead.X * 10);
                    TrackedHeadY = (int)(TrackedHead.Y * -10);

                    // Really, one should map the CameraSpacePoint to 
                    //  the angle between the location of the eyes on 
                    //  the physical screen and the tracked point. And stuff.                        //This is the TrackedHead Position (in Meters)
                    //The origin (x=0, y=0, z=0) is located at the center of the IR sensor on Kinect
                    //X grows to the sensor’s left
                    //Y grows up (note that this direction is based on the sensor’s tilt)
                    //Z grows out in the direction the sensor is facing
                    //1 unit = 1 meter

                    //Body
                    //body.Joints[JointType.Head].Position.X;
                    //body.Joints[JointType.Head].Position.Y;
                    //body.Joints[JointType.Head].Position.Z;

                    //Kinect (0,0,0)

                    //Screen Eyes (?,?,?)

它不詢問色框的原因是因為它不需要色框。 此方法將顏色框中的每個可能像素映射到其對應的3D坐標。 為此,它需要深度框,該深度框包含3D深度信息,該深度框允許軟件知道2D圖像的每個點在3D空間中的位置(我不知道它們是如何做到的,但我想可以通過光線投射來做到)。 如果您考慮一下,就無法從簡單的圖像(每個點僅包含顏色信息)重建3D世界。 如果有的話,根本就不需要Kinect,對嗎? 我們可以從簡單的相機中獲取深度信息:)

希望我的回答能幫助您理解,如果不清楚,請隨時提出。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM