public void TestLoggedImageData() { Stream fileStream = new FileStream(@"C:\Temp\temp.kinect", FileMode.Open); KinectReader reader = new KinectReader(fileStream, 640, 480); Bitmap frame = reader.GetImageAt(3); frame.Save(@"C:\Temp\export.bmp"); }
public void TestLoggedKinectData() { Stream fileStream = new FileStream(@"C:\Temp\2011_1_22_18_11.kinect", FileMode.Open); KinectReader reader = new KinectReader(fileStream, 640, 480); KinectExporter exporter = new KinectExporter(reader); using (Stream outputStream = new FileStream(@"C:\Temp\export.ply", FileMode.Create)) { exporter.ExportToPLYAtId(10, outputStream); } }
public SpatialReference(KinectReader kinectReader, PositionReader positionReader) { this.kinectReader = kinectReader; this.positionReader = positionReader; string wkt = "GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.0174532925199433]]"; this.wgs84 = (ICoordinateSystem)ProjNet.Converters.WellKnownText.CoordinateSystemWktReader.Parse(wkt); //hardcoded UTM 55S - should parameterize string toWKT = "PROJCS[\"WGS 72BE / UTM zone 55S\",GEOGCS[\"WGS 72BE\",DATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TOWGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",147],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",10000000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AUTHORITY[\"EPSG\",\"32555\"]]"; this.toCs = (ICoordinateSystem)ProjNet.Converters.WellKnownText.CoordinateSystemWktReader.Parse(toWKT); CoordinateTransformationFactory ctfac = new CoordinateTransformationFactory(); this.toGridtrans = ctfac.CreateFromCoordinateSystems(wgs84, toCs); }
public void TestRealWorld() { Stream fileStream = new FileStream(@"C:\Temp\2011_1_22_20_39.kinect", FileMode.Open); KinectReader kinectReader = new KinectReader(fileStream, 640, 480); Stream positionFileStream = new FileStream(@"C:\Temp\2011_1_22_20_39.location", FileMode.Open); PositionReader positionReader = new PositionReader(positionFileStream); SpatialReference reference = new SpatialReference(kinectReader, positionReader); KinectExporter exporter = new KinectExporter(null); using (Stream outputStream = new FileStream(@"C:\Temp\export.ply", FileMode.Create)) { var points = reference.GetRealWorldPointCloudAt(33); for (int i = 34; i <50; i++) { points.AddRange(reference.GetRealWorldPointCloudAt(i)); } exporter.ExportPointsToPLY(points, outputStream); } }
public KinectExporter(KinectReader reader) { this.reader = reader; }