コード例 #1
0
ファイル: KxStream.cs プロジェクト: rexcardan/KinectX
        public byte[] FusionCameraPose()
        {
            //Create a defined registration pattern - in this case a cube
            var cube    = CoordinateDefinition.Microcube();
            var yu2     = LatestYUVImage();
            var colorCv = new CvColor(yu2);
            //Find and draw (make sure it can be found)
            var markers = Vision.FindAruco(colorCv);

            if (!markers.Any())
            {
                return(PoseFormatter.PoseToBytes(new double[4, 4]));
            }                                                                          //zeros

            //Calculate pose
            var depth = LatestDepthImage();

            CameraSpacePoint[] _3dImage = new CameraSpacePoint[KinectSettings.COLOR_PIXEL_COUNT];
            KxBuffer.instance.coordinateMapper.MapColorFrameToCameraSpace(depth, _3dImage);
            var cvCameraSpace = new CvCameraSpace(_3dImage);
            var kxTransform   = Vision.GetPoseFromImage(cube, cvCameraSpace, markers);
            var pose          = kxTransform.FusionCameraPose;

            return(PoseFormatter.PoseToBytes(pose));
        }
コード例 #2
0
ファイル: KxStream.cs プロジェクト: rexcardan/KinectX
        public int GetArucoMarkerCount()
        {
            var yu2     = LatestYUVImage();
            var colorCv = new CvColor(yu2);
            //Find and draw (make sure it can be found)
            var markers = Vision.FindAruco(colorCv);

            return(markers.Count);
        }