public UnitedMarker(synesis.Rect cmarker, int ID) { this.ID = ID; TopLeft = new OPoint() { X = cmarker.LeftTop.X, Y = cmarker.LeftTop.Y }; BottomRight = new OPoint() { X = cmarker.RightBottom.X, Y = cmarker.RightBottom.Y }; FlashFor1D(); }
void GetData() { if (markerMode == MarkerMode.M1D) { //1d synesis.HeightMarkerCalibration hmarker = new synesis.HeightMarkerCalibration(); hmarker.MatrixFormat = calibrationMarkers.MatrixFormat.mformat; hmarker.FocalLength = calibrationMarkers.FocalLength; List<synesis.HeightMarker> hmarkerslist = new List<synesis.HeightMarker>(); synesis.HeightMarker hmark = new synesis.HeightMarker(); List<synesis.SurfaceNormal> snormals = new List<synesis.SurfaceNormal>(); synesis.SurfaceNormal normal = new synesis.SurfaceNormal(); normal.Point = new synesis.Point() { X = (int)calibrationMarkers.UnitedMarker1.Top.X, Y = (int)calibrationMarkers.UnitedMarker1.Top.Y }; normal.Height = (int)Math.Abs(calibrationMarkers.UnitedMarker1.Bottom.Y - calibrationMarkers.UnitedMarker1.Top.Y); snormals.Add(normal); normal = new synesis.SurfaceNormal(); normal.Point = new synesis.Point() { X = (int)calibrationMarkers.UnitedMarker2.Top.X, Y = (int)calibrationMarkers.UnitedMarker2.Top.Y }; normal.Height = (int)Math.Abs(calibrationMarkers.UnitedMarker2.Bottom.Y - calibrationMarkers.UnitedMarker2.Top.Y); snormals.Add(normal); hmark.SurfaceNormals = snormals.ToArray(); hmark.Height = calibrationMarkers.PhysicalHeight; hmarkerslist.Add(hmark); hmarker.HeightMarkers = hmarkerslist.ToArray(); model.Markers.Item = hmarker; } else { synesis.CombinedMarkerCalibration cmarker = new synesis.CombinedMarkerCalibration(); List<synesis.CombinedMarker> cmarkerslist = new List<synesis.CombinedMarker>(); synesis.CombinedMarker cmark = new synesis.CombinedMarker(); List<synesis.Rect> srects = new List<synesis.Rect>(); synesis.Rect rect = new synesis.Rect(); rect.LeftTop = new synesis.Point() { X = (int)calibrationMarkers.UnitedMarker1.TopLeft.X, Y = (int)calibrationMarkers.UnitedMarker1.TopLeft.Y }; rect.RightBottom = new synesis.Point() { X = (int)calibrationMarkers.UnitedMarker1.BottomRight.X, Y = (int)calibrationMarkers.UnitedMarker1.BottomRight.Y }; srects.Add(rect); rect = new synesis.Rect(); rect.LeftTop = new synesis.Point() { X = (int)calibrationMarkers.UnitedMarker2.TopLeft.X, Y = (int)calibrationMarkers.UnitedMarker2.TopLeft.Y }; rect.RightBottom = new synesis.Point() { X = (int)calibrationMarkers.UnitedMarker2.BottomRight.X, Y = (int)calibrationMarkers.UnitedMarker2.BottomRight.Y }; srects.Add(rect); cmark.Rectangles = srects.ToArray(); cmark.Height = calibrationMarkers.PhysicalHeight; cmark.Width = calibrationMarkers.PhysicalWidth; cmarkerslist.Add(cmark); cmarker.CombinedMarkers = cmarkerslist.ToArray(); model.Markers.Item = cmarker; } }
void ScaleRectInput(synesis.Rect rect) { DataConverter.ScalePointInput(rect.LeftTop, videoSourceSize, videoEncoderSize); DataConverter.ScalePointInput(rect.RightBottom, videoSourceSize, videoEncoderSize); }
void GetData() { if (markerMode == MarkerMode.M1D) { //1d synesis.HeightMarkerCalibration hmarker = new synesis.HeightMarkerCalibration(); hmarker.MatrixFormat = calibrationMarkers.MatrixFormat.mformat; hmarker.FocalLength = calibrationMarkers.FocalLength; List <synesis.HeightMarker> hmarkerslist = new List <synesis.HeightMarker>(); synesis.HeightMarker hmark = new synesis.HeightMarker(); List <synesis.SurfaceNormal> snormals = new List <synesis.SurfaceNormal>(); synesis.SurfaceNormal normal = new synesis.SurfaceNormal(); normal.Point = new synesis.Point() { X = (int)calibrationMarkers.UnitedMarker1.Top.X, Y = (int)calibrationMarkers.UnitedMarker1.Top.Y }; normal.Height = (int)Math.Abs(calibrationMarkers.UnitedMarker1.Bottom.Y - calibrationMarkers.UnitedMarker1.Top.Y); snormals.Add(normal); normal = new synesis.SurfaceNormal(); normal.Point = new synesis.Point() { X = (int)calibrationMarkers.UnitedMarker2.Top.X, Y = (int)calibrationMarkers.UnitedMarker2.Top.Y }; normal.Height = (int)Math.Abs(calibrationMarkers.UnitedMarker2.Bottom.Y - calibrationMarkers.UnitedMarker2.Top.Y); snormals.Add(normal); hmark.SurfaceNormals = snormals.ToArray(); hmark.Height = calibrationMarkers.PhysicalHeight; hmarkerslist.Add(hmark); hmarker.HeightMarkers = hmarkerslist.ToArray(); model.Markers.Item = hmarker; } else { synesis.CombinedMarkerCalibration cmarker = new synesis.CombinedMarkerCalibration(); List <synesis.CombinedMarker> cmarkerslist = new List <synesis.CombinedMarker>(); synesis.CombinedMarker cmark = new synesis.CombinedMarker(); List <synesis.Rect> srects = new List <synesis.Rect>(); synesis.Rect rect = new synesis.Rect(); rect.LeftTop = new synesis.Point() { X = (int)calibrationMarkers.UnitedMarker1.TopLeft.X, Y = (int)calibrationMarkers.UnitedMarker1.TopLeft.Y }; rect.RightBottom = new synesis.Point() { X = (int)calibrationMarkers.UnitedMarker1.BottomRight.X, Y = (int)calibrationMarkers.UnitedMarker1.BottomRight.Y }; srects.Add(rect); rect = new synesis.Rect(); rect.LeftTop = new synesis.Point() { X = (int)calibrationMarkers.UnitedMarker2.TopLeft.X, Y = (int)calibrationMarkers.UnitedMarker2.TopLeft.Y }; rect.RightBottom = new synesis.Point() { X = (int)calibrationMarkers.UnitedMarker2.BottomRight.X, Y = (int)calibrationMarkers.UnitedMarker2.BottomRight.Y }; srects.Add(rect); cmark.Rectangles = srects.ToArray(); cmark.Height = calibrationMarkers.PhysicalHeight; cmark.Width = calibrationMarkers.PhysicalWidth; cmarkerslist.Add(cmark); cmarker.CombinedMarkers = cmarkerslist.ToArray(); model.Markers.Item = cmarker; } }