Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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);
        }