Today's computer user has access to vast data processing and storage resources. These resources enable users to accomplish computing tasks that were impossible using previous generations of computers, particularly in the area of computer graphics. Modern computer graphics tools take advantage of these resources to create and display visually complex and highly detailed computer-generated images. The challenge then becomes to find user-friendly ways to input the large quantities of data required to define computer-generated images.
Most current computer-graphics tools enable users to modify or create graphics that have the appearance of depth, or appear to be three-dimensional. These tools typically create the appearance of three-dimensionality in a computer image by creating a mathematical representation of a three-dimensional object. Inputting the data needed to create the mathematical representation can be a very time consuming and tedious process. For example, most computer graphics tools require a user to specify three-dimensional information in multiple different image views and thus present a significant burden to users.
This summary is provided to introduce techniques and processes for graphics processing, which are further described below in the Detailed Description. This summary is not intended to identify essential features of the claimed subject matter, nor is it intended for use in determining the scope of the claimed subject matter.
This disclosure is directed to processes and techniques for imparting three-dimensional characteristics to images in a two-dimensional space. In one implementation, a user provides markup in an image canvas interface and provides corresponding markup in a shape palette. The shape palette presents a visual representation of three-dimensional information. Based on the user markup three-dimensional information is extracted from the shape palette and correlated with the user markup in the image canvas. The correlated three-dimensional information and user markup from the image canvas are processed to render an image with three-dimensional characteristics.
The detailed description is set forth with reference to the accompanying figures. In the figures, the left-most digit(s) of a reference number identifies the figure in which the reference number first appears. The use of the same reference numbers in different figures indicates similar or identical items.
Described herein are processes and techniques for imparting visual characteristics of three-dimensionality to graphic images in a two-dimensional space. The processes and techniques recognize that humans have the ability to infer three-dimensional (3D) structure from two-dimensional (2D) images. This ability applies to a variety of image formats, such as photographs, paintings, sketches, and line art. Often only a few 2D strokes are necessary to express the 3D shape of an object. An observer can often make an analogy between a stroke or mark in a 2D space and a corresponding 3D aspect or surface. The challenge in a computer graphics interface is to enable a user to use this ability to infer 3D structure to specify 3D information that can be interpreted by a computer graphics tool.
To enable a user to quickly specify 3D information in a 2D space (e.g., a computer graphics interface), the shape palette is introduced. In one example, a shape palette is a 2D image of a 3D object that stores salient 3D geometric information that can be extracted through user markup of the shape palette. A user provides a 2D primitive (e.g., a line, stroke or other shape) in a space on a user interface and then draws a corresponding primitive on the shape palette, 3D information is extracted from the shape palette based on the user markup and processed. Processing the 3D information can include copying, or warping, the 3D information to the 2D user interface. Multiple primitives can be marked up using a shape palette and rendered and combined to produce an overall image. From the transfer of a few sparse primitives, a 3D model surface can be extracted based on the 3D information transferred from the shape palette to the user interface. The shape palette can be marked-up in a single view (i.e., the shape palette need not be rotated or otherwise manipulated) to extract the desired 3D information. This is not intended to be limiting, however, and some implementations may utilize multiple shape palette views. Thus, the shape palette serves as an intuitive interface whereby a user can specify 3D visual aspects that the user wishes to impart to a 2D primitive or other visual image.
One approach to implementing the shape palette is to configure the shape palette as a 3D normal map. The normal map can be presented, for example, as a Lambertian-shaded image, such as a sphere. In one such example, the transfer of 3D information from the shape palette to a primitive involves the transfer of normal information from the shape palette to the primitive. Thus, a shape palette can comprise a plurality of pixels wherein each of the plurality of pixels is associated with a normal value. With a minimum amount of shape palette markup, a user can generate a sparse normal map. The sparse normal map is then processed to produce a dense normal map that can be further processed to produce a 3D surface or height image.
A shape palette can be generated using an orthographic projection of a 3D shape model and can store the inner product of a synthetic light and the 3D normal at each point in the projection (i.e., the shape palette utilizes Lambertian shading, for example). Shape palettes can consist of any suitable 3D model, such as sphere, a cone, a torus, and so on. Suitable ways of processing the 3D normal information from a shape palette to produce a dense normal field are discussed below.
Illustrative User Interface
Graphics tool interface 102 includes image canvas 104. Image canvas 104 enables a user of graphics tool interface 102 to provide shapes and/or markup to which the user wishes to impart 3D visual characteristics. Also included in graphics tool interface 102 is shape palette 106. Shape palette 106 is configured to receive user markup, and based on the user markup, to impart 3D information to the shapes and/or markup indicated in image canvas 104. Rendering canvas 108 displays an image that is rendered based on the shapes and/or markup from image canvas 104 and the user markup provided in shape palette 106.
In operation, a user provides an image and/or markup in image canvas 104. Markup refers generally to providing strokes, lines, curves or other graphic input, such as by using a freehand tool as part of a graphics application. In one example, a user can import an image file (e.g., in JPEG, bitmap, or any other suitable graphics format) to the image canvas and use the image as a stencil over which markup can be provided in the image canvas. As the user provides markup in the image canvas, the user provides corresponding markup in the shape palette. For example, a user can make a stroke in image canvas 104 and make a corresponding stroke in shape palette 106. The graphics tool will automatically correlate the two strokes and impart the 3D information indicated by the shape palette stroke to the corresponding stroke in image canvas 104. However, as discussed below, other methods may be used to correlate shape palette markup with image canvas markup. This markup correlation is discussed in more detail below. Based on the correlation between the image canvas markup and the shape palette markup, an image is rendered in rendering canvas 108. The image rendered in rendering canvas 108 includes 3D visual characteristics extracted from shape palette 106 (e.g., Lambertian shading).
At 202, an image is illustrated that is marked up in an image canvas. In this example, an image file is imported into the image canvas and the user provides markup over the image. This is not required, however, and a user can provide markup to the image canvas without importing an image. In other examples, a user can import a graphic image and provide shape palette markup to impart 3D characteristics to the graphic image by correlating lines and other shapes from the graphic image with the shape palette markup. User markup of the image canvas is illustrated at 204 through 220. The user markup of the image canvas can be classified in two different types of user markup. A first type of user markup is silhouette markup. Silhouette markup denotes regions in the image canvas where the 3D information is tangent to the markup primitive and is consider to lie within the plane of the canvas. For example, if a 2D straight line is drawn as silhouette markup, then the 3D directions that will be associated with that straight-line will be directions perpendicular to that line. This means the 3D information can be computed directly from the 2D image canvas markup, therefore corresponding markup on the shape palette is not necessary. In this example, markups 204 and 206 are silhouette markups and therefore do not require corresponding 3D markup in the shape palette. This is not intended to be limiting, however, and other examples may utilize silhouette markup in both the image canvas and the shape palette.
A second type of user markup is non-silhouette markup. Non-silhouette markup has corresponding markup in the image palette and enables a user to impart 3D visual characteristics to a rendered image. In this example, markups 208 through 220 are non-silhouette markups and have corresponding markups in the shape palette.
Shape palettes are shown at 222 and 224. While these are shown as two separate shape palettes, the images can be displayed together (as shown in
As discussed above, to impart 3D visual characteristics to an image, a user may mark up the image canvas and make corresponding markup to the shape palette. In this example, the user marks up image 202 and makes corresponding markup to shape palettes 222 and 224. For example, the user provides markup 208 to image 202 and provides corresponding markup 226 to shape palette 222. The user then provides markup 210 to image 202 and provides corresponding markup 228 to shape palette 224, and so on for the remaining image and shape palette markups. Thus, in this example, in addition to the previously discussed correspondence, image markup 212 corresponds to shape palette markup 230, image markup 214 corresponds to shape palette markup 232, image markup 216 corresponds to shape palette markup 234, image markup 218 corresponds to shape palette markup 236, and image markup 220 corresponds to shape palette markup 238. In this example, image markups 204 and 206 are silhouette markups and do not require shape palette markup.
Once a user has provided markup to an image canvas (e.g., markup of image 202) and corresponding markup to a shape palette (e.g., shape palettes 222 and 224), a rendered image 240 can be generated using the 3D information extracted from the shape palette(s). In this example, rendered image 240 is rendered based on the markup of image 202 and the corresponding markup of shape palettes 222 and 224.
Illustrative Shape Palette
Illustrative Processes
Illustrative processes are described in this section with additional reference to
The illustrative processes may be described in the general context of computer executable instructions and are illustrated as collections of blocks in logical flowcharts, which represent sequences of operations that can be implemented in hardware, software, or a combination thereof. Generally, computer executable instructions can include routines, programs, objects, components, data structures, procedures, modules, functions, and the like that perform particular functions or implement particular abstract data types. The processes may also be practiced in a distributed computing environment where functions are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, computer executable instructions may be located in both local and remote computer storage media, including memory storage devices.
Markup 412 of image 404 is a silhouette markup and, in this example, does not require corresponding 3D markup in shape palette 410. Other markups are non-silhouette markups and thus have corresponding markups in shape palette 410. The correspondence of image 404 markup and shape palette 410 markup is as follows: Image markup 414 corresponds to shape palette markup 416; Image markup 418 corresponds to shape palette markup 420; Image markup 422 corresponds to shape palette markup 424; Image markup 426 corresponds to shape palette markup 428; and Image markup 430 corresponds to shape palette markup 432. Based on the markup correspondence, 3D information is extracted from the shape palettes and imparted to the image markups, at 434, to render an image with the 3D characteristics. At 436, the rendered image is used to relight image 404 and create image 438 that displays 3D characteristics. Thus, the discussed techniques can be used to impart 3D characteristics to 2D images.
At 508, 3D information is extracted from the shape palette based on the user markup of the shape palette. The 3D information can include geometric information, such as normal values (e.g., in terms of x, y and z coordinates) and pixel values (e.g., brightness) for each point indicated in the user markup of the shape palette. At 510, the 3D information is processed to produce data that can generate an image with 3D characteristics. In some examples, normal values extracted from the shape palette are warped to the image canvas markup using geometric techniques such as thin-plate splines. At 512, an image with 3D characteristics is rendered using the data.
A normal represents a 3D direction in Euclidean space and can be expressed as n=[x,y,z]T. A unit normal is a normal whose x, y, and z components are of length one, i.e. 1=√{square root over (x2+y2+z2)}. An alternative representation of a normal may be denoted as
associated with a unit normal [x,y,z]T. Consider now we have an image, where each pixel is denoted by i, and we wish to have a normal associate with that pixel. We can denote each normal in the image
The shape palette can be considered as an image that has a normal at every pixel. The aforementioned markup procedure provides a way for the user to transfer the normals from the shape palette to the image canvas. In some cases, this transfer via markup is very spare, and the goal is to compute a dense normal image based on the sparse markup. The following illustrative method shows one way to estimate the pi component of the normal ni for all pixels in an image rendered with 3D characteristics. The same method can be used to estimate qi.
Consider an image that is set of normal values, G={iε1 . . . N}. G is a set of p's and N is the total number of pixels of the canvas. G can be estimated using the sparse set of normal values generated by user markup of the shape palette. The set of normal values generated by user markup of the shape palette is represented by the observation set O={{tilde over (p)}k|kεS}, where {tilde over (p)}k is known and S is the set of corresponding pixel locations. G can be obtained by solving the following associated energy function:
E(G)=log(P(O|G))+log(P(G)) (1)
where (P(O|G)) is the likelihood and (P(G)) is the prior. The likelihood can be defined as:
which measures the faithfulness of the output normal map to the input O; the prior P(G) is defined as:
where σ1,σ2,σ3 are the respective uncertainty measurements, and jεN(i) is the pixel locations of the first-order neighbors, that is surrounding pixels, of pixel i. The likelihood energy measures the faithfulness of the output dense normal map to the input O. The first exponent in the prior energy (3) enforces the smoothness of the normal orientation, while the second exponent minimizes the surface curvature corresponds to the output dense normal map. The values σ1,σ2,σ3 can be set by the user, which indicates the weight or importance of the associated exponents. The energy function (1) is convex with the above likelihood and prior definitions, and the associated optimization thus converges to a global optimal solution. Standard numerical optimization packages can be used to solve equation (1). From this dense normal map, G, estimated using equation (1), a 3D surface or height map can be generated using standard shape-from-normal estimation techniques.
Illustrative Apparatus
Apparatus 702 includes a system memory 704, processor(s) 706, and input/output components 708. Processor(s) 706 may include, for example, microprocessors, microcomputers, microcontrollers, multi-core processors, and so forth. Processor(s) 706 are configured to retrieve and execute computer-program instructions stored in system memory 704. System memory 704 includes computer-readable media in the form of volatile memory, such as Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash RAM. Input/output components 708 (e.g., a mouse and keyboard) provide data input and output capabilities for apparatus 702.
Embodied on system memory 704 are programming modules that can implement the discussed processes and techniques. Image canvas module 710 generates an image canvas and receives user markup of the image canvas. The image canvas module 710 can also import and export images as part of the image markup process. Shape palette module 712 generates and/or retrieves shape palettes and receives user markup of shape palettes. Rendering module 714 processes user markup of an image canvas and a shape palette to render an image with 3D characteristics. In some examples, rendering an image with 3D characteristics includes displaying the image. User interface module 716 generates and/or displays user interfaces that enable a user to interact with the apparatus and implement the discussed processes and techniques.
While various illustrative device and operating implementations have been described, the components, modules, and features of these implementations may be rearranged, modified, and/or may be omitted entirely, depending on the circumstances.
Also, it should be understood that certain acts in the methods need not be performed in the order described, may be rearranged, modified, and/or may be omitted entirely, depending on the circumstances.
Moreover, any of the acts described above with respect to any method may be implemented by a processor or other computing device based on instructions stored on one or more computer-readable media. Computer-readable media can be any available media that can be accessed locally or remotely by the resource modeling application. By way of example, and not limitation, computer-readable media may comprise volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. Computer-readable media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by the resource modeling application. Combinations of the any of the above should also be included within the scope of computer-readable media.
Conclusion
Although the invention has been described in language specific to structural features and/or methodological acts, it is to be understood that the invention is not necessarily limited to the specific features or acts described. Rather, the specific features and acts are disclosed as illustrative forms of implementing the invention.