This Background is intended to provide the basic context of this patent application and it is not intended to describe a specific problem to be solved.
Textures are important for the visual quality of 3D models of buildings. The texture is usually generated from a set of images of the original object. Many works deal with texturing models from multiple images, assuming that the 3D model is a very accurate one. Using such an accurate model, each image can be projected onto the model surface, and textures that originate from different images can fit nicely. However, in many cases we cannot use an accurate enough model, since we have not modeled one, or that we need to use a simplified or an approximated model for quick rendering or distribution. The difference between the approximate model and the real object may cause artifact where different images that are projected onto the approximated model to not fit well.
This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
A method and system of adding texture to a three dimensional object is disclosed. A first image and a second image of an object are obtained where the first image is related to the second image. The first image and the second image may be warped onto the object. The warped object may be divided into sites where sites are overlapping circular regions of the object. For each site, a neighborhood graph may be created where each site is a node in the graph and each pair of sites with overlapping regions is connected by an edge. A list of covers of each site may be created where the list contains all the possible labels for that node. Each image that covers part of the site may be reviewed including all possible shifts of each image plus or minus 2 pixels. A cost may be assigned to each cover and costs for each of the covers may be calculated. The cover with the lowest cost may be selected. If the costs are too high, the resolution may be lowered, one or more possible covers may be selected and then the analysis may be performed using the selected covers at a higher resolution.
Although the following text sets forth a detailed description of numerous different embodiments, it should be understood that the legal scope of the description is defined by the words of the claims set forth at the end of this patent. The detailed description is to be construed as exemplary only and does not describe every possible embodiment since describing every possible embodiment would be impractical, if not impossible. Numerous alternative embodiments could be implemented, using either current technology or technology developed after the filing date of this patent, which would still fall within the scope of the claims.
It should also be understood that, unless a term is expressly defined in this patent using the sentence “As used herein, the term ‘______’ is hereby defined to mean . . . ” or a similar sentence, there is no intent to limit the meaning of that term, either expressly or by implication, beyond its plain or ordinary meaning, and such term should not be interpreted to be limited in scope based on any statement made in any section of this patent (other than the language of the claims). To the extent that any term recited in the claims at the end of this patent is referred to in this patent in a manner consistent with a single meaning, that is done for sake of clarity only so as to not confuse the reader, and it is not intended that such claim term by limited, by implication or otherwise, to that single meaning. Finally, unless a claim element is specifically defined by reciting the word “means” and a function without the recital of any structure, it is not intended that the scope of any claim element be interpreted based on the application of 35 U.S.C. §112, sixth paragraph.
With reference to
The computer 110 may operate in a networked environment using logical connections to one or more remote computers, such as a remote computer 180, via a local area network (LAN) 171 and/or a wide area network (WAN) 173 via a modem 172 or other network interface 170.
Computer 110 typically includes a variety of computer readable media that may be any available media that may be accessed by computer 110 and includes both volatile and nonvolatile media, removable and non-removable media. The system memory 130 includes computer storage media in the form of volatile and/or nonvolatile memory such as read only memory (ROM) 131 and random access memory (RAM) 132. The ROM may include a basic input/output system 133 (BIOS). RAM 132 typically contains data and/or program modules that include operating system 134, application programs 135, other program modules 136, and program data 137.
The computer 110 may also include other removable/non-removable, volatile/nonvolatile computer storage media such as a hard disk drive 141 a magnetic disk drive 151 that reads from or writes to a magnetic disk 152, and an optical disk drive 155 that reads from or writes to an optical disk 156. The hard disk drive 141, 151, and 155 may interface with system bus 121 via interfaces 140, 150.
A user may enter commands and information into the computer 20 through input devices such as a keyboard 162 and pointing device 161, commonly referred to as a mouse, trackball or touch pad. Other input devices (not illustrated) may include a microphone, joystick, game pad, satellite dish, scanner, or the like. These and other input devices are often connected to the processing unit 120 through a user input interface 160 that is coupled to the system bus, but may be connected by other interface and bus structures, such as a parallel port, game port or a universal serial bus (USB).
A monitor 191 or other type of display device may also be connected to the system bus 121 via an interface, such as a video interface 190. In addition to the monitor, computers may also include other peripheral output devices such as speakers 197 and printer 196, which may be connected through an output peripheral interface 190.
Images such as images 300310 may be at different angles, heights, distances, focal lengths, camera types, etc. The images may be used to create an approximate geometry using the images 300310 and from the various sensors in which the object 305 is visible. The images 300310 may include a street-side perspective which may be useful for the lower parts of the building, a birds-eye view which may be useful for top part of the buildings, and Ultra-cam images which are useful mostly for the roofs. In one embodiment, the cameras are calibrated and bundled with known projection models.
Each input image may have a known resolution and a known fidelity which may be factored in when deciding which ones are preferred in each part of the façade. The output may be a single texture such as the texture in image 305 that is done in such a way to minimize visual artifacts.
In some embodiments, the method may proceed object by object and each object face may be textured separately. The method may also assume that mis-registration or misalignment of the object 305 from the images (such as 300, 310) may be constrained only to translations in the façade plane. This models the type of errors common seen, as camera rotation is solved much more accurately than translation. The images 300310 may be divided into a collection of overlapping regions and each will eventually contain image information from one of the sources 300310. The optimization process may be used to choose which part of which image is taken.
At block 210, the first image 300 and the second image 310 may be warped onto the object 305. The warping onto the face of the object 305 may occur as a pre-process. The pre-warping may define the maximal resolution that is used by reviewing the maximum resolution of the images 300310 used. In some embodiments, the image 300310 is stretched to reduce protrusions and indentations present in the image 300310 and then the image 300310 may be shrunk to fit the object 305.
At block 215, the object 305 may be divided into sites 400. Sites 400 may be overlapping circular regions of the object 305. For example,
Referring to
At block 225, a list of covers 420 of each site may be created. The list may contain all the possible covers for that node 400. For example, each square in
At block 230, each image 300310 from the list that covers part of the site 305 may be reviewed. Various factors may be obtained from the images 300310 such as a color measurement, a texture measurement, image density information, neighboring pixel information, etc.
At block 235, all possible shifts of each image plus or minus 2 pixels may be reviewed. In this way, image 300310 shifts may be taken into account and images 300310 that may be useful will not be overlooked. In addition, improved registration of the first image 300 and second image 310 may be obtained.
At block 240, a cost may be assigned to each cover 420. As previously explained, a cover may be an image 300310 that covers a site 400. For example, all the pixels 425 may be covered by site 400, meaning the image 300310 related to site 420 may be a cover 420 for pixels 425. Every choice of a cover 400 may have an associated cost which is a function of the image 300310 quality and coverage. When a multi-scale process is used, the solution from the coarser level may factor into the costs of the label in the current level.
In one embodiment, images 300310 with a higher quality have a lower cost than images 300310 with lower quality. Similarly, images 300310 that are similar have a lower cost and images that are different have a higher cost. The method may assign a higher cost to images 300310 that have different color values and a lower cost to images 300310 that have a similar color value. The method may also assign a higher cost to images 300310 that different have texture values and a lower cost to images that have a similar texture value. A higher cost may be assigned to images 300310 that have a different neighborhood and a lower cost may be assigned to images that are from a similar neighborhood. Other factors may be added to the cost equation and in some embodiments, the costs are given weights which may be adjusted by the application or by the user.
If the calculated costs of the various images 300310 is high, such as beyond a threshold, the method may switch to a lower resolution and the method may be repeated. For example, the problem may be approached in lower resolution to eliminate images 300310 that are not close in high resolution and propagating the solution to the next resolution. In such cases, the list at some resolution level will be an expansion of the best choices made in the level preceding it.
In order to cope with large size textures or many images 300310, the method may solve the texturing in a multi-scale image pyramid. In one embodiment, a Gaussian pyramid of the textures is used to find a solution from the coarsest to the finest resolution. Each level may be used as an initial guess for the next one. A site s at location (x, y) level l expands the list of options around the solutions of site si around location
in level l+1. Level 0 of the pyramid is the original resolution which is shrunk in subsequent levels (a factor of 2 for example, but if convergence isn't good enough a factor of √{square root over (2)} may also be used. The number of sites 400 in each level decreases quadratically. For example, in
Referring to
Θsr(xs, xr)=min{SSD(xsi, xsj−δ), SSD(xrj, xri+δ)′}
In this example, sites s,r which are neighbors due to the intersection of their neighborhood, have a cost that is proportional to the similarity of the shifted windows. A rectangular windows may be used for this comparison.
At block 245, the solution with the lowest cost may be used as the texture for the pixel in question. In other words, the pixel that has been determined to have the lowest cost and be most likely the correct pixel is used to create the pixel in question. Ideally, the cost of the overlap between two sites 400 would be 0. The method may iterate through different arrangements until the cost is as close to 0 as possible.
Although the foregoing text sets forth a detailed description of numerous different embodiments, it should be understood that the scope of the patent is defined by the words of the claims set forth at the end of this patent. The detailed description is to be construed as exemplary only and does not describe every possible embodiment because describing every possible embodiment would be impractical, if not impossible. Numerous alternative embodiments could be implemented, using either current technology or technology developed after the filing date of this patent, which would still fall within the scope of the claims.
Thus, many modifications and variations may be made in the techniques and structures described and illustrated herein without departing from the spirit and scope of the present claims. Accordingly, it should be understood that the methods and apparatus described herein are illustrative only and are not limiting upon the scope of the claims.