A non-transitory computer-readable storage medium storing a set of instructions that, when executed by one or more computer processors, causes the one or more computer processors to perform operations for aligning a digital model of a structure with a displayed portion of the structure within a video stream captured by a camera device, the operations comprising:
- determining an approximate position of the camera device in the digital model;
- determining a position and an orientation for a plurality of digital surfaces within the digital model visible from the approximate position of the camera device;
- receiving a video stream from the camera device;
- determining a position and an orientation of a plurality of object surfaces visible in the video stream;
- determining a 3D translation, a 3D scale, and a 3D rotation that maximize an alignment of the position and orientation of the plurality of digital surfaces with the position and orientation of the plurality of object surfaces, wherein the plurality of the digital surfaces includes a determined lowest horizontal digital surface and at least two vertical digital surfaces and the object surfaces visible on the video stream include a determined lowest horizontal object surface and at least two vertical object surfaces, wherein the determining of the 3D translation, the 3D scale, and the 3D rotation comprises limiting a rotation of the digital model around the first vertical axis and determining a vertical translation of the digital model so that the lowest horizontal digital surface is aligned with the lowest horizontal object surface visible on the video stream, determining a 2D translation, a 2D scale, and a 2D rotation that maximize an alignment of the vertical digital surfaces of the digital model with the vertical object surfaces visible on the video stream, combining the vertical translation and the limiting of rotation with the 2D translation, the 2D scale, and the 2D rotation to obtain the 3D translation, the 3D scale, and the 3D rotation, and wherein the determining of the 3D translation, the 3D scale, and the 3D rotation further comprises determining an observation height above a floor, determining an observation position in the digital model that corresponds to a distance of the observation height above the lowest horizontal digital surface and located on a line projected vertically from the position of the camera device within the digital model, casting a plurality of rays horizontally from the observation position in the digital model and creating a first 2D point cloud including a point for each location whereby a ray from the plurality of rays intersects with a vertical digital surface, determining a second observation position in the video stream that corresponds to a distance of the observation height above the lowest horizontal object surface and located on a line projected vertically from a position associated with the camera device within the video stream, casting a plurality of rays horizontally from the second observation position and creating a second 2D point cloud including a point for each location whereby a ray from the plurality of rays intersects a vertical object surface, and determining the 2D translation, the 2D scale, and the 2D rotation that maximize an alignment of the first point cloud and the second point cloud;
- and
- applying the 3D translation, the 3D scale, and the 3D rotation to the digital model and displaying the digital model contemporaneously with a display of the video stream.