The present invention relates generally to computer graphics and, more particularly, to a system and method for non-linear magnification of images.
Due to the growth of computing power, users are demanding more and more information from computers, and want the information provided in a visually useful form. Computers typically use a computer monitor as a display device. A problem with such two-dimensional displays is that a full image which is moderately complex may not be displayable all at once with the detail necessary. This may be due to the resolution of the information in the image and the resolution and size of the display surface. This problem is normally referred to as the “screen real estate problem.”
When a full image is not displayable on the monitor in its entirety, the displayable image which is substituted for the full image is often either a detail image or a global image, or a combination of the two. A global image is the full image with resolution removed to allow the entire image to fit onto the display surface of the display device. Of course, the resolution might be so low that details are not available from this substituted image. A detail image shows the details, but only of a portion of the full image. With a detail image, the details of the image are available, but the global context of the details are lost. If a combination is used, the connection between the detail image and the global image will not be visually apparent, especially where the detailed image obscures more of the global image than is shown in the detailed image. As a result, while the above solutions are suitable for a large number of visual display applications, they are less effective where the visual information is spatially related, such as maps, newspapers and the like.
A recent solution to the “screen real estate problem” is the application of “detail-in-context” presentation techniques for the display of large surface area media, such as maps. Detail-in-context presentations, also known as non-linear magnification or scaling, allow for magnification of a particular area of interest in an image while preserving visibility of the surrounding portion of the image. In other words, in non-linear magnification, selected areas are presented with an increased level of detail without the removal of contextual information from the original image. In general, non-linear magnification may be considered as a distorted view of a portion of the original image where the distortion is the result of the application of a “lens” like distortion function to the original image.
Non-linear magnification therefore works by scaling different parts of the image differently. Traditional distortion functions or magnification algorithms work by displacing and interpolating image pixels by applying a displacement mapping. These displacement algorithms compute the pixel displacement on the system central processing unit (CPU) before display. A disadvantage of such an approach, however, is that performance is compromised in that CPU's cannot perform the calculations of the algorithm fast enough to allow large, high resolution images to be manipulated by a user in real-time, such as by a graphical user interface (GUI). Furthermore, the speed at which the CPU can access texture memory is problematic in this regard. Maintenance of real-time interaction between the user and the system with regard to the non-linear magnification of large, high resolution images is desirable.
A computer system suitable for use in an embodiment of the non-linear magnification system and method of the present invention is illustrated in
As is known in the art, a GPU is a dedicated graphics rendering device for the system and is very efficient in manipulating and displaying computer graphics. The GPU features a highly parallel structure which makes it more effective than the CPU for a range of complex graphics algorithms.
As described previously, non-linear scaling or magnification works by scaling different parts of the image differently. As with traditional magnification algorithms, the magnification algorithm of the present invention works by displacing and interpolating image pixels. In the preferred embodiment of the invention, however, the GPU runs a shader program that includes the magnification algorithm. As a result the, the GPU performs the magnification calculations of the algorithm. Advances in GPU development allow the magnification calculations to be performed many times faster than if they were performed by the CPU. As a result, higher performance can be achieved which allows for high resolution images to be distorted and manipulated in real-time, such as by a GUI.
The increased speed of the magnification calculations allows for extremely high resolution images to be magnified and a minimal target frame rate of thirty frame per second may be maintained. Textures as large a 4K by 4K pixels can be magnified while maintaining this frame rate.
The shader program preferably is written in a shader programming language so that it can be incorporated into any program which has GPU shader support. An example of a suitable shader programming language is CG, which is a product of NVIDIA (www.nvidia.com). Alternative shader programming languages may be used instead.
The magnification algorithm of the shader program in a preferred embodiment of the system and method of the present invention will now be described. With reference to
The image 40 of
The inputs may be summarized for use in the magnification algorithm as follows (with the corresponding input from
In addition to the above inputs, the magnification algorithm also uses the following variables:
Upon receiving the inputs, the GPU runs the shader program so that the following steps of the magnification algorithm are performed for every pixel in the area of the image surrounded by the border:
1. With reference to
2. The length of that vector, dist, is used to compute the index for accessing the magnification LUT. This table, an example of which is illustrated in
3. The value obtained from the LUT represents a normalized pixel displacement. Using the value obtained from the LUT and the current magnification, a displacement uv coordinate (displacedUV) is computed. This displacement moves the location of the texture coordinate based on the equation:
displacedUV=uv−(beta*f)*P; //displace texture coordinate
The value obtained from the LUT represents a normalized pixel displacement. When this value is multiplied by the magnification factor (beta), the displacement can be increased or decreased depending on the value of beta. The displacement of the texture coordinate (uv) results in magnification, as the algorithm is automatically applied to all image pixels by the GPU when the shader program is executed.
4. To prevent the displaced uv coordinate from extending outside of the image, the border, illustrated in
5. The final step allows a smooth transition at the boundary of the magnification radius and the non-magnified area. This is done by altering a transparency factor (alpha). The alpha value, which is illustrated in
6. Finally, the magnified image is displayed on the display device (34 in
return image[displacedUV]*alpha; //return magnified image
Control of the magnification is preferably handled by a GUI, illustrated at 22 in
Use of the GUI of in the above embodiment of the invention will now be described with regard to
The user may adjust the radius of the circle, and therefore the area that is subjected to magnification, by dragging one of the square radius controls 66 in a direction perpendicular to the circle 62. More specifically, as illustrated in
The user adjusts the magnification of the area within the circle by clicking on one of the round magnification controls 68, as illustrated in
Returning to
The illustrated embodiment of the invention therefore provides faster magnification through use of a GPU. This permits the system to obtain large image distortion while maintaining real-time interaction through an easy to use GUI. The system provides arbitrary boundary definition and an arbitrary distortion profile using the LUT. The illustrated embodiment also provides multi-image composition through the use of alpha blending.
While embodiments of the invention have been shown and described, it will be apparent to those skilled in the art that changes and modifications may be made therein without departing from the spirit of the invention.