Пример #1
0
    List <object> GetViewpoints(IEnumerable <string> images)
    {
        var views = new List <object>();

        uint i = 0;

        foreach (var img in images)
        {
            var Id = ViewIDs.Get(img);

            views.Add(new
            {
                viewId      = Id,
                poseId      = Id,
                path        = img,
                intrinsicId = INTRINSIC_ID,
                rigId       = -1,
                subPoseId   = -1,
                metadata    = "",
            });

            i += 1;
        }

        return(views);
    }
Пример #2
0
    static (View view, PoseDesc pose) GnssToViewPose(GPSPosition origin, GPSPosition gnssPos, uint TimeStamp)
    {
        var frameNum = FrameChunks.FrameCloseTo(TimeStamp + 500, SourceVideo.TIME_BASE);
        var id       = ViewIDs.Get(frameNum);

        var pos  = origin.GetVector(gnssPos);
        var pose = new PoseDesc
        {
            poseId = $"{id}",
            pose   = new Pose
            {
                transform = new Transform
                {
                    center   = new float[] { pos.x, -pos.y, pos.z },
                    rotation = new float[]
                    {
                        1, 0, 0,
                        0, 1, 0,
                        0, 0, 1,
                    },
                }
            }
        };

        var view = new View
        {
            viewId   = pose.poseId,
            poseId   = pose.poseId,
            path     = frameNum.ToString("D4") + ".jpg",
            metadata = new Metadata {
            },
        };

        return(view, pose);
    }