Methods, storage media, and systems for generating a three-dimensional coordinate system
Methods, storage media, and systems for generating a three-dimensional coordinate system, evaluating quality of camera poses associated with images, scaling a three-dimensional model, and calculating an alignment transformation are disclosed.
1 . A method for generating a three-dimensional coordinate system, the method comprising:
receiving a first image and an associated first camera pose comprising a first camera location and a first camera orientation, wherein the first image and the first camera pose are associated with a capture coordinate system;
receiving a second image and an associated second camera pose comprising a second camera location and a second camera orientation, wherein the second image and the second camera pose are associated with the capture coordinate system;
receiving a first point in the first image;
receiving a second point in the second image, wherein the second point corresponds to the first point;
receiving a first two-dimensional (2d) line segment in the first image, wherein a first end point of the first 2d line segment is the first point, and wherein the first 2d line segment is colinear with the first point;
generating an origin for a first three-dimensional (3d) coordinate system based on the first camera pose, the second camera pose, the first point, the second point, and the first 2d line segment by projecting the first point and second point onto a first ground plane, projecting the first camera location and second camera location onto the first ground plane and setting the origin at an intersection of a first line connecting the projected first camera location and projected first point and a second line connecting the projected second camera location and projected second point; and
generating a 3d line segment based on the first 3d coordinate system and the first 2d line segment.
2 . The method of claim 1 , wherein the first 2d line segment corresponds to a real-world object depicted in the first image.
3 . The method of claim 1 , wherein the first 2d line segment corresponds to an attribute of the first image.
4 . The method of claim 1 , wherein the first 2d line segment is horizontal relative to a ground plane based on the first image.
5 . The method of claim 1 , wherein generating the first 3d coordinate system further comprises projecting the origin of the first 3d coordinate system orthogonally relative to the first ground plane based on the first point.
6 . The method of claim 5 , wherein generating the first 3d coordinate system further comprises rotating axes of the first 3d coordinate system based on the first 2d line segment.
7 . The method of claim 6 , wherein rotating the axes of the first 3d coordinate system is further based on a slope of the first 2d line segment.
8 . The method of claim 6 , wherein rotating the axes of the first 3d coordinate system comprises aligning an axis of the axes of the first 3d coordinate system with the first 2d line segment.
9 . The method of claim 8 , wherein the aligned axis of the axes of the first 3d coordinate system is parallel with the first 2d line segment.
10 . The method of claim 6 , wherein rotating the axes of the first 3d coordinate system is further based on a gravity vector associated with the first image.
11 . The method of claim 1 , further comprising:
generating a 3d model with reference to the first 3d coordinate system.
12 . The method of claim 11 , wherein generating the 3d model is based on a plurality of images including the first image and the second image.
13 . The method of claim 11 , wherein the 3d model comprises the 3d line segment.
14 . The method of claim 8 , further comprising:
receiving a third image and an associated third camera pose comprising a third camera location and a third camera orientation, wherein the third image and the third camera pose are associated with the capture coordinate system;
receiving a fourth image and an associated fourth camera pose comprising a fourth camera location and a fourth camera orientation, wherein the fourth image and the fourth camera pose are associated with the capture coordinate system;
receiving a third point in the third image, wherein the third point corresponds to the first point;
receiving a fourth point in the fourth image, wherein the fourth point corresponds to the first point;
receiving a second 2d line segment in the third image, wherein a first end point of the second 2d line segment is the third point, and wherein the second 2d line segment is colinear with the third point; and
generating an origin for a second 3d coordinate system based on the third camera pose, the fourth camera pose, the third point, the fourth point, and the second 2d line segment by projecting the third point and fourth point onto a second ground plane, projecting the third camera location and fourth camera location onto the second ground plane and setting the origin at an intersection of a third line connecting the projected third camera location and projected third point and a fourth line connecting the projected fourth camera location and projected fourth point.
15 . The method of claim 14 , wherein generating the second 3d coordinate system further comprises projecting the origin of the second 3d coordinate system orthogonally relative to the second ground plane based on the third point.
16 . The method of claim 15 , wherein generating the second 3d coordinate system further comprises rotating axes of the second 3d coordinate system based on the second 2d line segment.
17 . The method of claim 16 , wherein rotating the axes of the second 3d coordinate system comprises aligning an axis of the axes of the second 3d coordinate system with the second 2d line segment.
18 . The method of claim 17 , wherein the aligned axis of the axes of the second 3d coordinate system is parallel with the second 2d line segment.
19 . The method of claim 17 , further comprising:
calculating a score based on the alignment of the axis of the axes of the first 3d coordinate system with the first 2d line segment and the alignment of the axis of the axes of the second 3d coordinate system with the second 2d line segment.
20 . The method of claim 19 , wherein the score quantifies a variation between the alignment of the axis of the axes of the first 3d coordinate system with the first 2d line segment and the alignment of the axis of the axes of the second 3d coordinate system with the second 2d line segment.