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); }
public static void PhotogrammImages( string MeshroomComputeBin, string SensorDatabase, string VocTree, string ImagesDir, TimeBase TimeBase, uint LastFrame, ComputeProgress ComputeProgressCB, AutoResetEvent AbortEvent) { var chunks = FrameChunks.GetChunks(TimeBase, LastFrame); var graphs = MeshroomGraphs(SensorDatabase, VocTree, ImagesDir, chunks); int chunkNum = 0; foreach (var graph in graphs) { RunMeshroomCompute(MeshroomComputeBin, ImagesDir, graph, chunkNum, (done) => ComputeProgressCB(chunkNum, done), AbortEvent); chunkNum += 1; } /* clean-up last meshroom cache directory */ RemoveCacheDir(ImagesDir, chunkNum); }