private static void PrepareSegmentsForCropVisibleTest(CameraModel camera, Interval chordInterval, out Segment2 chord, out Segment2 segment2, out Segment3 segment3) { chord = new Segment2(camera.Domain.GetEdge(0).PointAt(0.177), camera.Domain.GetEdge(1).PointAt(0.643)); segment2 = new Segment2(chord.PointAt(chordInterval.Min), chord.PointAt(chordInterval.Max)); var spaceExteriorPoint1 = 2.56 * camera.LineOfSight(segment2.Start); var spaceExteriorPoint2 = 4.86 * camera.LineOfSight(segment2.End); segment3 = new Segment3(spaceExteriorPoint1, spaceExteriorPoint2); }
public void Projection_of_a_point_on_the_LineOfSight_of_a_given_image_point_equals_to_the_image_point() { var camera = new CameraModel(focalLength: 7.13, principalPoint: new Vector2(-3.14, 2.88), domain: new Box2(minX: -4, minY: -2, width: 5, height: 8)); var imagePoint = new Vector2(0.144, 2.71828); var spacePoint = 0.577 * camera.LineOfSight(imagePoint); var roundTrip = camera.Project(spacePoint); Expect(roundTrip != null); Expect(Vector2.Distance(roundTrip.Value, imagePoint), Is.LessThan(_tolerance)); }