public SingleFrameResultXml(ISingleFrameResult result) { if (result.HeadPoints == null) { HeadPoints = null; HeadPoint = null; } else { HeadPoints = result.HeadPoints.Select(x => new PointFXml(x.X, x.Y)).ToArray(); HeadPoint = HeadPoints[2]; } SmoothedHeadPoint = new PointFXml(result.SmoothedHeadPoint); Orientation = new VectorXml(result.Orientation); CentroidSize = result.CentroidSize; PelvicArea = result.PelvicArea; Velocity = result.Velocity; AngularVelocity = result.AngularVelocity; Distance = result.Distance; PelvicArea2 = result.PelvicArea2; PelvicArea3 = result.PelvicArea3; PelvicArea4 = result.PelvicArea4; Centroid = new PointFXml(result.Centroid); }
public SingleFrameExtendedResultXml(ISingleFrameExtendedResults result) { if (result.HeadPoints == null) { HeadPoints = null; HeadPoint = null; MidPoint = null; } else { HeadPoints = result.HeadPoints.Select(x => new PointFXml(x.X, x.Y)).ToArray(); HeadPoint = HeadPoints[2]; MidPoint = new PointFXml(result.HeadPoints[1].MidPoint(result.HeadPoints[3])); } if (result.BodyContour != null) { BodyContour = result.BodyContour.Select(x => new PointXml(x)).ToArray(); } else { BodyContour = null; } SmoothedHeadPoint = new PointFXml(result.SmoothedHeadPoint); Orientation = new VectorXml(result.Orientation); CentroidSize = result.CentroidSize; PelvicArea = result.PelvicArea; Velocity = result.Velocity; AngularVelocity = result.AngularVelocity; Distance = result.Distance; PelvicArea2 = result.PelvicArea2; PelvicArea3 = result.PelvicArea3; PelvicArea4 = result.PelvicArea4; Centroid = new PointFXml(result.Centroid); if (result.Whiskers != null) { Whiskers = new WhiskerCollectionXml(result.Whiskers); } else { Whiskers = null; } if (result.AllWhiskers != null) { AllWhiskers = new WhiskerCollectionXml(result.AllWhiskers); } else { AllWhiskers = null; } if (result.BestTrackedWhisker != null) { BestTrackedWhisker = new WhiskerCollectionXml(result.BestTrackedWhisker); } else { BestTrackedWhisker = null; } }