# Patent

## Title
Method for creating 3D virtual reality from 2D images

## Abstract

A method that enables creation of a 3D virtual reality environment from a series of 2D images of a scene. Embodiments map 2D images onto a sphere to create a composite spherical image, divide the composite image into regions, and add depth information to the regions. Depth information may be generated by mapping regions onto flat or curved surfaces, and positioning these surfaces in 3D space. Some embodiments enable inserting, removing, or extending objects in the scene, adding or modifying depth information as needed. The final composite image and depth information are projected back onto one or more spheres, and then projected onto left and right eye image planes to form a 3D stereoscopic image for a viewer of the virtual reality environment. Embodiments enable 3D images to be generated dynamically for the viewer in response to changes in the viewer's position and orientation in the virtual reality environment.

## Background
This application is a continuation in part of U.S. Utility patent application Ser. No. 13/874,625, filed 1 May 2013, the specification of which is hereby incorporated herein by reference.


BACKGROUND OF THE INVENTION
1. Field of the Invention
One or more embodiments of the invention are related to the field of image analysis and image enhancement, and computer graphics processing of two-dimensional (2D) images into three-dimensional (3D) stereoscopic images. More particularly, but not by way of limitation, one or more embodiments of the invention enable a method for creating 3D virtual reality environments from 2D images. One or more 2D images of a scene are obtained and are converted to a format that provides three-dimensional views for use in a virtual reality environment. These three-dimensional views may be generated dynamically based on the viewer's position and orientation in the virtual reality environment by applying depth information associated with the scene. Depth information may be accepted by the system for regions in raster or vector format or obtained externally and utilized in the conversion process.
2. Description of the Related Art
3D viewing is based on stereographic vision, with different viewpoints from one or more images provided to the left and right eyes to provide the illusion of depth. Many techniques are known in the art to provide 3D viewing. For example, specialized glasses may be utilized for viewing 3D images, such as glasses with color filters, polarized lenses, or anamorphic lenses. Some 3D viewing methods use separate screens for left eye and right eye images, or project images directly onto the left eye and right eye.
Virtual reality environments typically are computer-generated environments that simulate user presence in either real world or computer-generated worlds. The systems utilized to display the virtual reality environment typically include a stereoscopic display for 3D viewing and generally instrument a viewer with one or more sensors, in order to detect and respond to the position, orientation, and movements of the viewer. Based on these values, the virtual reality environment generates images to provide an immersive experience. The immersive experience may also include other outputs such as sound or vibration. Images may be projected onto screens, or provided using specialized glasses worn by the user.
The vast majority of images and films historically have been captured in 2D. These images or movies are not readily viewed in 3D without some type of conversion of the 2D images for stereoscopic display. Thus 2D images are not generally utilized to provide realistic 3D stereoscopic virtual reality environments. Although it is possible to capture 3D images from stereoscopic cameras, these cameras, especially for capturing 3D movies, are generally expensive and/or cumbersome 3D cameras. Specifically, there are many limitations with current 3D camera systems including prices and precision of alignment and minimum distance to a subject to be filmed for example.
The primary challenge with creating a 3D virtual reality environment is the complexity of generating the necessary stereo images for all possible positions and orientations of the viewer. These stereo images must be generated dynamically in approximately real-time as the viewer moves through the virtual reality environment. This requirement distinguishes 3D virtual reality from the process of generating 3D movies from 2D images as the location of the viewer is essentially fixed at the location of the camera.
Approaches in the existing art for 3D virtual reality rely on a detailed three-dimensional model of the virtual environment. Using the 3D model, left and right eye images can be generated by projecting the scene onto separate viewing planes for each eye. Computer-generated environments that are originally modeled in 3D can therefore be viewed in 3D virtual reality. However, creating these models can be extremely time-consuming. The complexity of creating a full 3D model is particularly high when it is desired to create a photo-realistic 3D model of an actual scene. This modeling effort requires that all shapes be defined and positioning in 3D in great detail, and that all colors and textures of the objects be set to match their counterparts in the real scene. Existing techniques for creating 3D virtual environments are therefore complex and time-consuming. They require extensive efforts from graphic artists and 3D modelers to generate the necessary realistic 3D models. Hence there is a need for a method for creating 3D virtual reality from 2D images.
BRIEF SUMMARY OF THE INVENTION
Embodiments of the invention enable a method for creating 3D virtual reality from 2D images. A set of 2D images may be obtained from an environment, which may for example be a real physical environment such as a room, a computer-generated environment, or a mix of physical and computer-generated elements. 2D images may be captured using a camera aimed at various angles to form a panoramic collection of images covering a desired part of a scene. In some embodiments the collection of images may cover an entire sphere, providing 360° viewing in all directions (including left-to-right and up and down). Embodiments of the invention enable converting these 2D images into a 3D virtual reality experience. A viewer in the virtual reality environment may be able to view the environment from various locations and orientations, and perceive three-dimensional depth reflecting the physical or modeled characteristics of the captured scene.
In one or more embodiments of the invention, subsets of the 2D images are first stitched together, using for example common features or overlapping pixels. The integrated, stitched images may then be projected onto a spherical surface to form a complete 360 degree view of the scene (or a desired portion thereof) in any direction (left to right as well as up and down). The spherical surface provides a complete spherical view of the scene, but this view is still two-dimensional since it lacks any depth information. Embodiments of the invention enable addition of depth information to the spherical display. In one or more embodiments, the spherical surface image is unwrapped onto a plane. This unwrapped image may be divided into regions to assist in generating depth information. Depth information is generated for the points of the regions. Depth information may comprise for example, without limitation, depth maps, bump maps, parallax maps, U maps, UV maps, disparity maps, ST maps, point clouds, z maps, offset maps, displacement maps, or more generally any information that may provide a three-dimensional shape or three-dimensional appearance to an image. Using the spherical surface image and the assigned depth information for the points of the regions, 3D stereoscopic images may be generated for a viewer in a 3D virtual reality environment. The depth information determines the amount of offset for each point between the left eye and right eye images, which provides a three-dimensional viewing experience.
Different embodiments of the invention may use various methods for generating the stereo images using the depth information. In one or more embodiments, the depth information may be projected onto a sphere, yielding spherical depth information that provides depth for all or a portion of the points on the sphere. Spherical depth information may comprise for example, without limitation, spherical depth maps, spherical bump maps, spherical parallax maps, spherical U maps, spherical UV maps, spherical disparity maps, spherical ST maps, spherical point clouds, spherical z maps, spherical offset maps, spherical displacement maps, or more generally any information that may provide a three-dimensional shape or three-dimensional appearance to a spherical surface. The unwrapped plane image is also projected onto a spherical surface to form the spherical image. Left and right eye images may then be generated using the spherical depth information. For example, if the depth information is a depth map that provides a z-value for each pixel in one or more 2D images, the spherical depth information may be a spherical depth map that provides a z-value for each point on the sphere. In this case left and right images may be formed by projecting each image point from its spherical depth position onto left and right image planes. The position and orientation of the left and right image planes may depend on the position and orientation of the viewer in the virtual reality environment. Thus the stereo images seen by the viewer will change as the viewer looks around the virtual reality environment in different directions. The projections from the spherical depth map points onto the left and right image planes may for example use standard 3D to 2D projections to a plane using a different focal point for each eye.
In other embodiments of the invention a different method may be used to generate the stereographic images. This method first generates a stereo image in 2D using the unwrapped plane image and the plane depth information. The left and right images are then projected onto spheres, with a separate left sphere and right sphere for the left and right images. Based on the position and orientation of the viewer in the virtual reality environment, left and right image planes and eye positions are calculated, the left sphere is projected onto the left image plane, and the right sphere is projected onto the right image plane.
In one or more embodiments, the regions of the unwrapped plane image may be used to assist in creating the depth information. One or more regions may be mapped onto flat or curved surfaces, and these surfaces may be positioned and oriented in three-dimensional space. In some embodiments constraints may be applied manually or automatically to reflect continuous or flexible boundaries between region positions in space. Depth information may be generated directly from the region positions and orientations in three-dimensional space by relating the depth to the distance of each point from a specified viewpoint.
In some embodiments it may be desirable to modify the 2D images from the scene in order to create a 3D virtual reality environment. For example, objects may be captured in the 2D images that should not appear in the virtual reality environment; conversely it may be desirable to insert additional objects that were not present in the 2D images. Operators may edit the original images, the unwrapped 2D image, the spherical images, or combinations of these to achieve the desired effects. Removing an object from the environment consists of replacing the pixels of the removed object with a suitable fill, which may be obtained automatically from surrounding regions. Adding an object consists of inserting an image and applying the appropriate depth information to the region or regions of the added image. Inserted images may be obtained from real objects or they may be computer generated, or they may be a combination of real images and computer generated images. Objects in the 2D images may also be extended in some embodiments to fill areas that were not captured in the original images, or that are in areas where undesired objects have been removed. Some embodiments may add objects in multiple layers at multiple depths, providing for automatic gap filling when the viewpoint of a viewer in the 3D virtual reality environment changes to reveal areas behind the original objects in the scene.



BRIEF DESCRIPTION OF THE DRAWINGS
The patent or application file contains at least one drawing executed in color. Copies of this patent or patent application publication with color drawing(s) will be provided by the Office upon request and payment of the necessary fee.
The above and other aspects, features and advantages of the invention will be more apparent from the following more particular description thereof, presented in conjunction with the following drawings wherein:
FIG. 1 illustrates a flowchart of at least one embodiment of a method for creating 3D virtual reality from 2D images.
FIG. 1A illustrates a flowchart of at least one embodiment of a method for generating 3D virtual reality in which stereo images are generated using spherical depth information that positions 2D pixels relative to the surface of a sphere in 3D space.
FIG. 1B illustrates a flowchart of at least one embodiment of a method for generating 3D virtual reality in which stereo images are generated first in 2D, then projected onto separate left and right spheres, and finally converted to stereo in a 3D viewing environment.
FIG. 2 illustrates an embodiment of a step to capture a series of 2D images of an environment by aiming a camera in varying horizontal and vertical angles.
FIG. 3 illustrates an embodiment of a step to stitch sets 2D images together into integrated 2D images; in this illustration four 2D images from FIG. 2 are stitched together into an integrated image by aligning matched features.
FIG. 4 illustrates an embodiment of a step to project integrated 2D images onto a spherical surface.
FIG. 5 illustrates an example of a spherical surface image that results from projecting 2D images onto a sphere.
FIG. 6 illustrates an example of a spherical surface image that is unwrapped into a panoramic 2D image. (Note that this scene is different from the scene shown in FIG. 5.)
FIG. 7 illustrates an embodiment of a step of dividing the unwrapped image of FIG. 6 into multiple regions; each region is color-coded with a color mask to identify its boundaries.
FIG. 8 illustrates an embodiment of a step of assigning a depth map to the points of each of the regions of FIG. 7; darker points are closer to the viewer.
FIG. 9 illustrates an anaglyph 3D stereoscopic view of the scene depicted in FIG. 7 with the depth map of FIG. 8.
FIG. 10 illustrates an embodiment of a step of creating a spherical depth map from a 2D depth map as outlined in the flowchart of FIG. 1A.
FIG. 11 illustrates an embodiment of a step of generating left and right stereo 2D views from a spherical depth map.
FIG. 12 illustrates an embodiment of a step of generating separate left and right spherical surface images, which are subsequently used to create stereo views, using a 2D image and a 2D depth map, as outlined in the flowchart of FIG. 1B.
FIG. 13 illustrates an embodiment of a division of a 2D image of a human figure into regions, with each region assigned a distinct color for identification.
FIG. 14 illustrates an embodiment of positioning and orienting the regions of FIG. 13 in 3D space in order to generate depth information.
FIG. 15 illustrates an embodiment of a depth map generated from the 3D model of FIG. 14.
FIG. 16 illustrates the 2D images captured from a scene as shown in FIG. 2, highlighting features where modifications are desired to the images in order to form the 3D virtual reality environment.
FIG. 17 illustrates an unwrapped image formed from the 2D images of FIG. 16 with the desired modifications made to the image.



DETAILED DESCRIPTION OF THE INVENTION
A method for creating 3D virtual reality from 2D images will now be described. In the following exemplary description numerous specific details are set forth in order to provide a more thorough understanding of embodiments of the invention. It will be apparent, however, to an artisan of ordinary skill that the present invention may be practiced without incorporating all aspects of the specific details described herein. In other instances, specific features, quantities, or measurements well known to those of ordinary skill in the art have not been described in detail so as not to obscure the invention. Readers should note that although examples of the invention are set forth herein, the claims, and the full scope of any equivalents, are what define the metes and bounds of the invention.
FIG. 1 illustrates a flowchart of at least one embodiment of a method for creating 3D virtual reality from 2D images, including exemplary components that may be utilized therewith. In step 101, multiple 2D images are obtained of environment 100, yielding a set of 2D images 102. Environment 100 may for example be a room, an office, a building, a floor, a house, a factory, a landscape, or any other scene or combination of scenes for which a virtual reality experience is to be created. This environment may be real, or it may itself be virtual or computer generated, or it may be a mix of real elements and computer generated elements. The step 101 of obtaining 2D images may use for example one or more cameras—including single image and video cameras—or any other sensor or sensors that capture non-visible frequencies such as radar or lidar. For computer-generated images the cameras may be virtual and the 2D images may be viewing projections of a 2D or 3D computer generated scene. As will be discussed, the depth information associated with an image may be accepted by the system, for example by providing user interface elements for users to draw masks on regions or user interface elements to set parameters for auto-generation of masks for regions of luminance, color or other image parameters. The system thus enables the user to assign depth information to regions in the 2D image or alternatively or in combination, obtain depth via radar or lidar to generate a depth map for example.
Step 103 stitches together subsets of the 2D images 102 into integrated 2D images 104. The stitching process combines and aligns 2D images and eliminates overlap among the 2D images. Stitching step 103 may combine all 2D images into a single panorama, or it may combine subsets of 2D images into various panoramic images that cover portions of the entire environment 100. Different embodiments may employ different stitching strategies. Integrated images may cover all or any portion of the sphere of view directions visible from one or more cameras.
Any known technique for stitching together multiple images into a composite integrated image may be utilized. Stitching may be done manually, automatically, or with a hybrid manual-automatic procedure where one or more operators make rough stitching and software completes the smooth stitch. Embodiments of the invention may utilize any or all of these approaches.
Automated stitching typically aligns the overlap regions of multiple images using a best-fit based on feature differences or on pixel differences. Feature-based methods perform a feature extraction pass first on the images, and then find the location of similar features in multiple images for alignment. See for example: M. Brown and D. Lowe (2007). Automatic Panoramic Image Stitching using Invariant Features. International Journal of Computer Vision, 74(1). Pixel-based methods minimize the pixel differences between images in their regions of overlap. See for example: Suen et al. (2007). Photographic stitching with optimized object and color matching based on image derivatives. Optics Express, 15(12).
In addition, several existing software packages perform stitching using either of both of these methods; illustrative examples include commonly available photo processing software. Embodiments of the invention may use any of the methods known in the art or available in software packages to perform the image stitching step 103.
In step 105, the integrated 2D images 104 are projected onto a spherical surface. In some embodiments, these projections may use a measured or estimated position and orientation of the camera or cameras used in step 101 to capture the 2D images that formed the integrated 2D images. The output of step 105 is a spherical surface image 106. A spherical surface represents an approximate 3D model of the location of the objects in the environment 100; this approximate model places all points on the objects equidistant from the center of the sphere. Adjustments to this approximate 3D model may be made in subsequent steps using depth information to form more realistic models of the environment.
In step 107 the spherical surface image 106 is “unwrapped” onto an unwrapped plane image 108. This unwrapping process may use any of the spherical-to-plane projection mappings that are known.
In step 109, the unwrapped plane image 108 is divided into regions 110. This step may be done by one or more operators, or it may be assisted by software. For example, software may tentatively generate region boundaries based on shapes, colors, or textures of objects in the unwrapped image 108.
In step 111, depth information 112 is assigned to the points of the regions 110. The depth information is used in subsequent steps to generate the 3D stereo images for a virtual reality experience. Depth information reflects how far away each point of each region is from a viewer. Many techniques for defining and using depth information are known in the art; any of these techniques may be used for generating or using the depth information 112. For example, without limitation, depth information may comprise depth maps, bump maps, parallax maps, U maps, UV maps, disparity maps, ST maps, point clouds, z maps, offset maps, displacement maps, or more generally any information that may provide a three-dimensional shape or three-dimensional appearance to an image. Assigning of depth information may be done by one or more operators. In some embodiments software may be used to assist the step 111 of assigning depth information. For example, operators may be able to rotate or reposition entire regions in a 3D scene, and depth information may be generated automatically for the regions based on this 3D positioning. Software may also be used to generate curved regions or to blend depth information at boundaries between regions.
In step 114, the depth information 112 and the unwrapped image 108 are used as inputs to generate stereo images for a viewer at viewer position and orientation 113. The stereo images consist of a left eye image 115 and a right eye image 116. Any of the commonly available stereo 3D vision technologies, such as special viewing glasses used to see 3D movies, may be used by the viewer to view the virtual reality environment in 3D using these stereo images. For example, viewers may use glasses with different colored left and right lenses, or glasses with different polarization in left and right lenses, or glasses with LCD lenses that alternately show left and right images.
FIGS. 2-9 illustrate exemplary embodiments of the steps of FIG. 1 in greater detail, while FIGS. 1A and 1B are discussed after FIGS. 2-9.
FIG. 2 illustrates an embodiment of step 101—obtaining 2D images of environment 100. In this example the environment 100 is a room with a table 203 approximately in the center of the room. A series of 2D images 201 is obtained of the room using a camera aimed at different angles. In this example the 2D images 201 are captured in five rows 202a, 202b, 202c, 202d and 202e, where each row corresponds to a vertical angle for the camera. Within each row the camera is aimed at 12 different horizontal angles, with an increment 204 of approximately 30° between each horizontal angle, forming a complete 360° panorama of the scene 100. Other embodiments of the invention may use different techniques and angle increments for capturing a series of 2D images to cover a desired portion of an environment 100.
FIG. 3 illustrates an embodiment of step 103—stitching together 2D images into integrated images. Image 301, 302, 303, and 304 are individual 2D images from row 202e of FIG. 2. A manual or automated scan for shared features identifies, for example, the back of the chair which appears as 305a in image 301 and as 305b in image 302, and the right front table leg which appears as 306a in image 303 and as 306b in image 304. Aligning the images on these (and other) shared features produces the rough stitch 307. Different embodiments of the invention may use various grouping strategies for stitching together integrated images in step 103. For example, all of the images in a row (such as row 202e of FIG. 2) may be stitched together, or portions of rows (as shown here in FIG. 3) may be stitched together. Stitching may also be done vertically (in columns) in addition to or instead of horizontally (in rows), or with mixed approaches to combine similar images.
FIG. 4 illustrates an embodiment of step 105—projecting the integrated 2D images onto spherical surface 403. Many techniques are known in the art for projecting plane images onto a sphere and for the reverse process of projecting spherical images onto a plane. These techniques are similar to known techniques of cartography, which generate 2D map images of a spherical surface or a portion thereof. For example, maps may use projections such as Mercator, Lambert cylindrical, Azimuthal, Orthographic, and many others. Projecting 2D plane images onto a sphere amounts to reversing the normal map projections that project a sphere onto plane images.
Different embodiments of the invention may employ different projection techniques. FIG. 4 illustrates a spherical projection that may be used in one or more embodiments of the invention. In this projection, each 2D image is considered to be a plane perspective projection of a spherical surface using a fixed point of perspective for the projection. The projection of the 2D image to the sphere simply reverses the perspective projection. Multiple images may be projected to the same spherical surface using location and orientation of the camera when each image was captured.
In FIG. 4 2D images 401 and 402 are projected onto the sphere 403. Sphere 403 has center point c 404, and radius R 405. Image 401 was obtained using a camera with a viewer located at point v1 406; image 402 was obtained using a camera with a viewer located at point v2 410. The orientation of the planes of images 401 and 402 correspond to the orientation of the cameras used to capture those images. Each point on the 2D images 401 and 402 is projected to the sphere along a ray from the camera's viewer. For example, point p 407 is projected onto point q 408 on sphere 403. Since the ray from v1 through p is parameterized as {v1+t(p−v1): t≧0}, point q can be obtained easily by finding the parameter t such that |v1+t(p−v1)−c|=R.
FIG. 5 illustrates a spherical projection of the 2D images from FIG. 2. Images are projected onto spherical surface 501. For example, the 2D table image 203 from FIG. 2 appears as image 502 on sphere 501.
FIG. 6 illustrates an unwrapped image obtained from a spherical projection via step 107—unwrap onto plane image. Converting the spherical image to a plane unwrapped image amounts to reversing the projections illustrated in FIG. 4 using a single projection of the sphere onto a plane. Note that the scene illustrated in FIG. 6 is not the same scene illustrated in FIGS. 2 and 4. In this unwrapped image the straight edges of the rug appear as curved lines such as 601. The unwrapped image is a 360 degree panorama; for example the left edge 602a of the chair corresponds to the right edge 602b. 
FIG. 7 illustrates an embodiment of step 109—dividing the unwrapped image into regions—applied to the unwrapped image of FIG. 6. Each region is indicated by a different color mask. For example, the blue mask 701 defines the rug in the center of the room. The system may enable the user to define masks for regions in the image and accept input for the masks by an operator, for example by implementing software on a computer system specifically for that purpose, or using a combination of methods. For example, the rug 601 in FIG. 6 has a distinct color and pattern that may used to automatically or semi-automatically identify the blue mask region 701 in FIG. 7. The system may thus enable the user to input a foreground distance and background distance for mask region 701 for example. Alternatively, radar or lidar may be obtained and utilized to auto generate depths for portions or the entire image or masks or regions therein.
FIG. 8 illustrates an embodiment of step 111—generating depth information for the points of the regions defined in step 109. In the example shown in FIG. 8, the depth information is encoded as a depth map, with points closer to the viewer shown with darker shades of grey, and points further from the viewer shown with lighter shades of grey. For example, the front edge 801 of the table in the center of the room has a dark shade since it is close to a viewer in or near the center of the room; the wall 802 behind the couch has a lighter shade since it is further from the viewer. Operators may assign depth information to individual pixels, or they may use the region masks to assist in defining depth information by positioning and rotating the regions in three dimensional space. Numerical depth information that is not visible, for example compressed or encoded may also be utilized.
FIG. 9 illustrates an embodiment of step 114—generating stereo images. In this example the unwrapped image from FIG. 6 is combined with the depth map from FIG. 8 to generate left and right eye images, which are superimposed here on the same anaglyph image. This anaglyph image provides a 3D stereoscopic view of the scene when viewed through anaglyph glasses with different color filters in the two lenses. The amount of shift between left eye and right eye images for each pixel is a function of the depth map for that pixel.
Returning to FIG. 1, embodiments of the invention may use various techniques in step 114 to generate the stereo images 115 and 116. As illustrated in FIG. 9, embodiments may use the depth information 112 to shift the display of pixels in left eye images versus right eye images, with closer pixels being shifted a greater amount. FIGS. 1A and 1B illustrate specific techniques that may be used by some embodiments of the invention to perform step 114.
FIG. 1A illustrates a technique wherein step 114 comprises two additional steps 120 and 123. In step 120, the unwrapped image 108 and the depth information 112 are both projected onto a sphere. This process yields spherical image 121 and spherical depth information 122. FIG. 10 illustrates the generation of a spherical depth map, which is an example of spherical depth information 122. Spherical depth information may comprise for example, without limitation, spherical depth maps, spherical bump maps, spherical parallax maps, spherical U maps, spherical UV maps, spherical disparity maps, spherical ST maps, spherical point clouds, spherical z maps, spherical offset maps, spherical displacement maps, or more generally any information that may provide a three-dimensional shape or three-dimensional appearance to a spherical surface. 2D depth map 1001 contains two regions: region 1002 is closer to the viewer (hence shaded darker) and region 1003 is further from the viewer (hence shaded lighter). Depth map 1001 is projected via projection 1004 to the sphere 1005. Regions with greater depth (further from the viewer) are pushed further away from the center of the sphere to form a spherical depth map. Hence spherical region 1006, corresponding to planar region 1002, is closer to the center of sphere 1005 than spherical region 1007, corresponding to planar region 1003.
In addition, in FIG. 1A, spherical image 121 and spherical depth information 122 are used in step 123 to generate left eye image 115 and right eye image 116. FIG. 11 illustrates this process in greater detail. Viewer 1110 is observing a virtual reality scene from a specific position and orientation. The viewer 1110 has a left eye position 1111 and a right eye position 1112. 2D images and a 2D depth map have been projected onto sphere 1005. The image contains black colored region 1101, which is located near the center of the sphere, and speckled region 1102, which is located far from the center of the sphere. The left eye image is formed by projecting points from the sphere onto the left eye plane 1113a; similarly the right eye image is formed by projecting points from the sphere onto the right eye plane 1114a. The center point of region 1101 is projected onto point 1115a in the left eye plane, and onto point 1117a in the right eye plane. The center point of region 1102 is projected onto point 1116a in the left eye plane, and onto point 1118a in the right eye plane. The detailed views of the left eye image 1113b and of the right eye image 1114b show that the relative shift of the regions 1101 and 1102 depends on the depth of each region on the spherical depth map: Left eye image 1115b of region 1101 is offset significantly from right eye image 1117b of region 1101, whereas left eye image 1116b of region 1102 is only slightly offset from right eye image 1118b of region 1102.
FIG. 1B illustrates a different technique for forming left and right eye images that may be used by one or more embodiments of the invention. In comparison to the technique illustrated in FIG. 1A, this technique first forms planar stereo images and then projects these onto left and right spheres. This is an alternative technique to that shown in FIG. 1A, which first projects onto a sphere, and then forms stereo images thereafter. In step 130, the unwrapped planar image 108 is combined with the depth information 112 to form a left unwrapped image 131 and a right unwrapped image 132. Each of the unwrapped images 131 and 132 is then projected onto a sphere, forming a left sphere 135 and a right sphere 136. In the final steps 137 and 138 the spheres 135 and 136 are projected on left eye image 115 and right eye image 116 respectively.
FIG. 12 illustrates an embodiment of the details of steps 130, 133 and 134. Unwrapped planar image 108 contains regions 1202 and 1203. Depth map 112 assigns a depth 1205 to region 1202 and a depth 1206 to region 1203; the darker shading of depth 1206 vs. depth 1205 indicates that object 1203 is closer to the viewer than object 1202. Step 130 combines unwrapped image 108 and depth map 112 to form left unwrapped image 131 and right unwrapped image 132. The left image position 1202a of object 1202 is offset only slightly from the right position 1202b of object 1202 based on object 1202's, whereas the left image position 1203a of object 1203 is offset considerably from the right position 1203b of object 1203. These offset differences reflect the depth differences of the objects in depth map 112. In step 133 the left unwrapped image 131 is projected onto left sphere 135. Similarly in step 134 the right unwrapped image 132 is projected onto right sphere 136. These spherical projections can be performed as previously described using any suitable plane-to-sphere projection technique. Left planar image 1202a is projected onto left sphere image 1202c, and right planar image 1202b is projected onto right sphere image 1202d. Similarly left planar image 1203a is projected onto left sphere image 1203c, and right planar image 1203b is projected onto right sphere image 1203d. Returning to FIG. 1B, the steps 137 and 138 generate left eye image 115 and right eye image 116 from the spherical images 135 and 136 respectively. Any of the previously described techniques or any other known technique for projecting from a sphere to a plane may be used for these steps 137 and 138.
Returning again to FIG. 1, the depth information 112 may be generated by assigning a depth to the points of the regions 110 of the unwrapped image. In one or more embodiments of the invention, one or more portions of the depth information may be generated by defining a flat or curved surface for one or more of the regions, and positioning and orienting these surfaces in three-dimensional space using rotations and translations. The depth information for the points of a region can then be generated automatically using the three-dimensional model of the region surface, simply by picking a view position and calculating the depth of each point as the distance from the view position to the point. Some embodiments may use other techniques for calculating depth from a three-dimensional model, such as using orthogonal projections instead of point projections, or using nonlinear scaling between distance and depth.
FIGS. 13 through 15 illustrate an embodiment of this procedure for positioning and orienting region surfaces or masks. Embodiments of the invention may utilize any and all methods and apparatus described in U.S. patent application entitled “EXTERNAL DEPTH MAP TRANSFORMATION METHOD FOR CONVERSION OF TWO-DIMENSIONAL IMAGES TO STEREOSCOPIC IMAGES”, U.S. Ser. No. 13/874,625, filed 1 May 2013, the specification of which is hereby incorporated herein by reference. In FIG. 13 a 2D image of a human figure is divided into regions. Each region is assigned a distinct color for identification. Region 1301 is one side of the figure's chest; region 1302 is the front of the figure's neck. In FIG. 14 a surface corresponding to each region is positioned and oriented in 3D space. Surface 1401 in FIG. 14 corresponds to region 1301 in FIG. 13, and surface 1402 in FIG. 14 corresponds to region 1302 in FIG. 13. By obtaining depth information from a depth sensor, such as but not limited to radar or lidar for example, the regions 1301 and 1302 may be positioned using the generally noisy depth information as shown in FIG. 14. Surfaces may be flat, or they may be curved surfaces such as for example Bézier surfaces or NURBS surfaces. In some embodiments, each surface may be positioned or adjusted by an operator using 3D editing or compositing tools. In one or more embodiments software may assist in determining approximate positioning and orientation of each surface, or in applying constraints reflecting joints along surface boundaries. This enables the elimination of depth noise in the data to effectively smooth the regions shown in FIG. 14 to have edges that approximate the edges shown in FIG. 13 for example. Specifically, steps 109 or 111 or both in FIGS. 1, 1A and 1B, embodiments of the invention may obtain the generate regions and/or obtain depth information from an external system or sensor, for example separate from, coupled to or combined with a camera or cameras utilized to obtain the 2D images in step 101. The system may auto-generate masks for the regions within a certain tolerance or curve and calculate best fit for the planar or curved mask in step 109. For example, in some embodiments the surfaces of adjacent regions may be constrained to meet exactly or approximately in 3D space along their boundaries. In other embodiments these constraints may be relaxed to simulate spring-like forces between adjacent regions, and software may position regions to minimize the energy associated with these spring-like forces. Various combinations of manual positioning, automatic positioning, and application of hard or soft constraints may be used in different embodiments of the invention. FIG. 15 shows a depth map generated from the 3D positions and orientations of the surfaces in FIG. 14, for example through use of a function to eliminate noise and/or discontinuities in regions or masks, as performed by accepting user input or through use of smoothing algorithms or any combination thereof. Darker pixels indicate points closer to the viewer. Point 1501 in FIG. 15 has a darker shade than point 1502, reflecting the positioning of surface 1401 in FIG. 14 closer to the viewer than surface 1402.
In one or more embodiments of the invention, modifications may be made to the images captured from the scene in order to create a modified 3D virtual reality environment. Such modifications may include additions, deletions, modifications, or any combinations of these changes to the images. Modifications may be made in some embodiments to the original captured 2D images, to the stitched integrated images, to the spherical projection, to the unwrapped plane image, to the depth information, to the stereo images, or to any combinations of these. FIGS. 16 and 17 illustrate an embodiment with modifications made to the unwrapped plane image. FIG. 16 shows an example of a series of 2D images 201 captured from a scene, as is illustrated also in FIG. 2. In this illustrative example, it is desired to make modifications to images 1601, 1603, and 1605. Image 1601 contains equipment 1602 that was put in place to capture the images of the scene, as well as an image of an operator who was capturing the scene; it is desired to remove these items from the virtual reality environment. Image 1603 shows wall 1604 behind the desk; it is desired to add an image of a person in front of this wall in the virtual reality environment. Image 1605 shows a portion of the legs 1606 of the desk, but the 2D images did not capture the entire image of the legs; it is desired to extend these legs to form the complete desk in the virtual reality environment.
Image 17 illustrates an unwrapped image 1701 formed from the images of FIG. 16, with the desired modifications made to the unwrapped image. Equipment 1602 is removed from 1701 at location 1702. Human FIG. 1703 is inserted into empty area 1604. The table legs 1606 are extended to form complete table legs 1704. These modifications may be made using tools and techniques commonly utilized in the art for photo and image compositing. Objects that are inserted or extended require modifications to the unwrapped image, or elsewhere in the processing chain, as well as depth information. In some embodiments the composite image and depth information may be generated in multiple layers, so that multiple objects may exist along a radius from the center of the viewing sphere, but at different depth locations. With multi-layered depth information, a viewer in the virtual reality environment may see certain objects exposed as he changes his view position. This technique provides for automatic gap-filling as pixels in the stereographic images are shifted to provide the 3D view.
While the invention herein disclosed has been described by means of specific embodiments and applications thereof, numerous modifications and variations could be made thereto by those skilled in the art without departing from the scope of the invention set forth in the claims.

## Claims

1. A method for creating 3D virtual reality from 2D images comprising:
obtaining a plurality of 2D images of an environment from at least one camera;
stitching together said plurality of 2D images into one or more integrated 2D images of said environment;
projecting said one or more integrated 2D images onto a spherical surface, yielding a spherical surface image;
unwrapping said spherical surface image onto an unwrapped plane image;
dividing said unwrapped plane image into a plurality of regions;
assigning depth information to points of each of said plurality of regions; and
generating stereo images for a viewer at a viewer position and orientation in a virtual reality environment using said depth information and said unwrapped plane image;
wherein said assigning depth information to the points of each of said plurality of regions comprises
defining a flat or curved surface for one or more of said plurality of regions;
rotating and translating said flat or curved surface for one or more of said plurality of regions in three-dimensional space; and,
obtaining said depth information from the three-dimensional space of the points on said flat or curved surface for one or more of said plurality of regions.

2. The method of claim 1, wherein said generating stereo images for said viewer further comprises the steps:
projecting said unwrapped plane image and said depth information onto said spherical surface, yielding a modified spherical surface image and spherical depth information;
generating a left eye image and a right eye image for said viewer using said spherical depth information and using the location and orientation of said viewer in said virtual reality environment.

3. The method of claim 1, wherein said generating stereo images for said viewer further comprises the steps:
generating a left eye unwrapped plane image and a right eye unwrapped plane image using said depth information and said unwrapped plane image;
projecting said left eye unwrapped plane image onto a left eye spherical surface, yielding a left eye spherical surface image;
projecting said right eye unwrapped plane image onto a right eye spherical surface, yielding a right eye spherical surface image;
generating a left eye image for said viewer using said left eye spherical surface image and using a location and an orientation of said viewer in said virtual reality environment;
generating a right eye image for said viewer using said right eye spherical surface image and using the location and the orientation said viewer in said virtual reality environment.

4. The method of claim 1, further comprising
inserting one or more objects into said unwrapped plane image.

5. The method of claim 1, further comprising
removing one or more objects from said unwrapped plane image.

6. The method of claim 1, further comprising
extending one or more objects appearing in said unwrapped plane image.

7. The method of claim 1, wherein said dividing said unwrapped plane image into a plurality of regions further comprises accepting mask region inputs to define objects in said plurality of 2D images.

8. The method of claim 1, further comprising accepting external depth information and applying said external depth information to said plurality of regions.

9. The method of claim 8, further comprising adjusting said plurality of regions to eliminate depth noise.

10. A method for creating 3D virtual reality from 2D images comprising:
obtaining a plurality of 2D images of an environment from at least one camera;
stitching together said plurality of 2D images into one or more integrated 2D images of said environment;
projecting said one or more integrated 2D images onto a spherical surface, yielding a spherical surface image;
unwrapping said spherical surface image onto an unwrapped plane image;
dividing said unwrapped plane image into a plurality of regions,
wherein said dividing said unwrapped plane image into a plurality of regions further comprises accepting mask region inputs to define objects in said plurality of 2D images;

accepting external depth information and applying said external depth information to said plurality of regions;
obtaining at least one mask within each of said plurality of regions;
assigning depth information to points of each of said plurality of regions;
calculating a best fit for a plane using a computer based on depth associated with each of the at least one mask;
applying depth associated with the plane having the best fit to each of said plurality of regions;
generating stereo images for a viewer at a viewer position and orientation in a virtual reality environment using said depth information and said unwrapped plane image; and,
altering automatically using said computer, any combination of position, orientation, shape, depth or curve of the plane in order to fit edges or corners of the plane with another plane.

11. The method of claim 10, wherein said generating stereo images for said viewer further comprises the steps:
projecting said unwrapped plane image and said depth information onto said spherical surface, yielding a modified spherical surface image and spherical depth information;
generating a left eye image and a right eye image for said viewer using said spherical depth information and using the location and orientation of said viewer in said virtual reality environment.

12. The method of claim 10, wherein said generating stereo images for said viewer further comprises the steps:
generating a left eye unwrapped plane image and a right eye unwrapped plane image using said depth information and said unwrapped plane image;
projecting said left eye unwrapped plane image onto a left eye spherical surface, yielding a left eye spherical surface image;
projecting said right eye unwrapped plane image onto a right eye spherical surface, yielding a right eye spherical surface image;
generating a left eye image for said viewer using said left eye spherical surface image and using a location and an orientation of said viewer in said virtual reality environment;
generating a right eye image for said viewer using said right eye spherical surface image and using the location and the orientation said viewer in said virtual reality environment.

13. The method of claim 10, wherein said assigning depth information to the points of each of said plurality of regions comprises:
defining a flat or curved surface for one or more of said plurality of regions;
rotating and translating said flat or curved surface for one or more of said plurality of regions in three-dimensional space;
obtaining said depth information from the three-dimensional space of the points on said flat or curved surface for one or more of said plurality of regions.

14. The method of claim 10, further comprising
inserting one or more objects into said unwrapped plane image.

15. The method of claim 10, further comprising
removing one or more objects from said unwrapped plane image.

16. The method of claim 10, further comprising
extending one or more objects appearing in said unwrapped plane image.

17. The method of claim 10, further comprising adjusting said plurality of regions to eliminate depth noise.