Data serialization extrusion for converting two-dimensional images to three-dimensional geometry
Systems, methods, and devices for data serialization extrusion of input images and raw input data. A method includes determining an input image comprising one or more lines and generating a bitmap based on the input image. The method includes performing edge detection on the bitmap to identify the one or more lines in the input image by applying a growth algorithm to pixels of the bitmap. The method includes calculating a pixel width of each of the one or more lines in the input image.
1 . A method, comprising:
determining an input image comprising one or more lines; generating a bitmap based on the input image;
performing edge detection on the bitmap to identify the one or more lines in the input image by applying a growth algorithm to pixels of the bitmap; and
calculating a pixel width of each of the one or more lines in the input image, comprising:
identifying a peak for each of the one or more lines, wherein the peak of the line represents one or two center-most pixels of the line;
applying a decay algorithm to each of the one or more lines, wherein the decay algorithm begins at the peak of each of the one or more lines;
removing one layer at a time via the growth algorithm and the decay algorithm from each of the one or more lines until the peak of the one or more lines is reached; and
determining the pixel width or thickness of each of the one or more lines based on the number of layers removed to reach the peak of each of the one or more lines;
selecting a line of the one or more lines and identifying a peak starting point for the line;
following the peak of the line in a first direction along a length of the line, beginning at the peak starting point and terminating at a first ending point of the line;
following the peak of the line in a second direction along the length of the line, beginning at the peak starting point and terminating at a second ending point of the line;
wherein the first ending point of the line and the second ending point of the line define a geometry of the line;
identifying an artifact in the one or more lines of the input image;
deciding to keep or discard the artifact;
extruding serialized data comprising a geometric vector diagram based on the geometry of the line; and
generating a three-dimensional rendering of an interior space based on the geometric vector diagram, the input image, and the decision to keep or discard the artifact.
2 . The method of claim 1 , wherein the input image comprises a two-dimensional drawing of an architectural floorplan, and wherein the method further comprises identifying walls in the architectural floorplan based on one or more of the pixel width of each of the one or more lines, a color of pixels within the architectural floorplan, or regions defined within the architectural floorplan.
3 . The method of claim 2 , further comprising:
applying a Z-axis height to the walls in the architectural floorplan; and
wherein the geometric vector diagram can be used to generate the three-dimensional rendering of the architectural floorplan illustrated in the input image.
4 . The method of claim 1 , wherein the input image comprises a two-dimensional drawing of an architectural floorplan, and wherein the method further comprises identifying enclosed regions within the architectural floorplan.
5 . The method of claim 4 , wherein identifying the enclosed regions within the architectural floorplan comprises:
identifying a first pixel comprising an empty value and filling in the first pixel with a color;
applying a flood fill to an enclosed region comprising the first pixel by identifying neighboring pixels to the first pixel and filling in the neighboring pixels with the color;
recursively applying the flood fill to additional neighboring pixels within the enclosed region; and
terminating the flood fill for the enclosed region when perimeter pixels comprising non-empty values are reached by the flood fill.
6 . The method of claim 5 , further comprising identifying a plurality of enclosed regions and applying a different color to each of the plurality of enclosed regions.
7 . The method of claim 1 , further comprising applying a stencil buffer to the bitmap, and wherein performing edge detection on the bitmap comprises performing edge detection on the bitmap after the stencil buffer has been applied.
8 . The method of claim 1 , further comprising:
determining input data wherein the input image data includes code from an augmented reality program;
determining a second line based on the code from the augmented reality program, wherein the second line is used for the three-dimensional rending.
9 . The method of claim 1 , wherein the input image includes data from a light detection ad ranging (LIDAR) device the data represents a LIDAR scan of the interior space.
10 . The method of claim 1 , wherein the three-dimensional rendering is a three-dimensional model that is interactive in real-time and the three-dimensional model can be amended by a user to change the three-dimensional model.
11 . A system comprising one or more processors configurable to execute instructions stored in non-transitory computer readable storage media, the instructions comprising:
determining an input image comprising one or more lines;
generating a bitmap based on the input image;
performing edge detection on the bitmap to identify the one or more lines in the input image by applying a growth algorithm to pixels of the bitmap; and
calculating a pixel width of each of the one or more lines in the input image, comprising:
identifying a peak for each of the one or more lines, wherein the peak of the line represents one or two center-most pixels of the line; and
applying a decay algorithm to each of the one or more lines, wherein the decay algorithm begins at the peak of each of the one or more lines;
removing one layer at a time via the growth algorithm and the decay algorithm from each of the one or more lines until the peak of the one or more lines is reached; and
determining the pixel width or thickness of each of the one or more lines based on the number of layers removed to reach the peak of each of the one or more lines;
selecting a line of the one or more lines and identifying a peak starting point for the line;
following the peak of the line in a first direction along a length of the line, beginning at the peak starting point and terminating at a first ending point of the line;
following the peak of the line in a second direction along the length of the line, beginning at the peak starting point and terminating at a second ending point of the line;
wherein the first ending point of the line and the second ending point of the line define a geometry of the line;
identifying an artifact in the one or more lines of the input image;
deciding to keep or discard the artifact;
extruding serialized data comprising a geometric vector diagram based on the geometry of the line; and
generating a three-dimensional rendering of an interior space based on the geometric vector diagram, the input image, and the decision to keep or discard the artifact.
12 . The system of claim 11 , wherein the input image comprises a two-dimensional drawing of an architectural floorplan, and wherein the instructions further comprise identifying walls in the architectural floorplan based at least in part on the pixel width of each of the one or more lines.
13 . Non-transitory computer readable storage media storing instructions for execution by one or more processors, the instructions comprising:
determining an input image comprising one or more lines;
generating a bitmap based on the input image;
performing edge detection on the bitmap to identify the one or more lines in the input image by applying a growth algorithm to pixels of the bitmap;
calculating a pixel width of each of the one or more lines in the input image, comprising;
removing one layer at a time via the growth algorithm and a decay algorithm from each of the one or more lines until a peak of the one or more lines is reached; and
determining the pixel width or thickness of each of the one or more lines based on the number of layers removed to reach the peak of each of the one or more lines;
identifying an artifact in the one or more lines of the input image;
deciding to keep or discard the artifact;
extruding serialized data comprising a geometric vector diagram based on the geometry of the line; and
generating a three-dimensional rendering of an interior space based on the geometric vector diagram, the input image, and the decision to keep or discard the artifact.
14 . The non-transitory computer readable storage media of claim 13 , wherein the input image comprises a two-dimensional drawing of an architectural floorplan, and wherein the instructions further comprise:
identifying walls in the architectural floorplan based at least in part on the pixel width of each of the one or more lines;
applying a Z-axis height to the walls in the architectural floorplan; and
wherein the geometric vector diagram can be used to generate the three-dimensional rendering of the architectural floorplan illustrated in the input image.
15 . The non-transitory computer readable storage media of claim 13 , wherein the input image comprises a two-dimensional drawing of an architectural floorplan, and wherein the instructions further comprise identifying enclosed regions within the architectural floorplan.
16 . The non-transitory computer readable storage media of claim 15 , wherein the instructions are such that identifying the enclosed regions within the architectural floorplan comprises:
identifying a first pixel comprising an empty value and filling in the first pixel with a color;
applying a flood fill to an enclosed region comprising the first pixel by identifying neighboring pixels to the first pixel and filling in the neighboring pixels with the color;
recursively applying the flood fill to additional neighboring pixels within the enclosed region; and
terminating the flood fill for the enclosed region when perimeter pixels comprising non-empty values are reached by the flood fill.
17 . The non-transitory computer readable storage media of claim 13 , wherein the instructions further comprise applying a stencil buffer to the bitmap, and wherein the instructions are such that performing edge detection on the bitmap comprises performing edge detection on the bitmap after the stencil buffer has been applied.
18 . The non-transitory computer readable storage media of claim 13 , wherein the calculating the pixel width of each of the one or more lines further comprises:
identifying the peak for each of the one or more lines, wherein the peak of the line represents one or two center-most pixels of the line; and
applying the decay algorithm to each of the one or more lines, wherein the decay algorithm begins at the peak of each of the one or more lines;
selecting a line of the one or more lines and identifying a peak starting point for the line;
following the peak of the line in a first direction along a length of the line, beginning at the peak starting point and terminating at a first ending point of the line; and
following the peak of the line in a second direction along the length of the line, beginning at the peak starting point and terminating at a second ending point of the line;
wherein the first ending point of the line and the second ending point of the line define a geometry of the line.