Not Applicable
Not Applicable.
A blur is a common filter used to change the appearance of an image or part of an image. A Gaussian blur is a convolution filter (i.e. linear filter). An output signal is computed by convolving an entering signal and a response of a filter to a delta impulse. The response of the filter to the delta impulse is also known as a point spread function (“PSF”). In a Gaussian blur, the PSF is a Gaussian distribution (i.e. a bell-shape curve). During the convolution operation, each output pixel is calculated as the weighted average of neighboring input pixels. The Gaussian distribution ensures that a blur weights closer pixels more than pixels that are further away. In theory, the Gaussian distribution is infinite but tends towards zero rapidly; therefore, the numerical implementation of the convolution algorithm truncates the distribution where weighting coefficients are very close to zero. This is known as using a finite impulse response (“FIR”). It is commonly accepted that the quality of a Gaussian blur is sufficient when the actual width of the convolution window/kernel is set to 6 times the standard deviation of the Gaussian distribution.
A Gaussian blur smoothes sharp details in an image and is known as a low-pass filter. “Low-pass” is a signal processing term to qualify a filter that blurs a signal, in other words, a transformation that filters out high-frequencies and keeps low-frequencies. In contrast, high-pass filters sharpen edges in an image and therefore are not compatible with the scale-down idea that actually blurs the image.
Among convolution filters, a Gaussian blur is decomposable. Instead of convolving the image with a two dimensional Gaussian distribution and computing W×W (where “W” is the width of a Gaussian window/kernel) weighting multiplications and additions for each output pixel, the filter is decomposable into two one dimensional passes where only 2×W weighting multiplications and additions for each output pixel is needed. Even with this enhancement, a Gaussian blur window/kernel can be large with a filter that is computationally intensive. And while this method produces a very high quality blur, it also requires more time to render than a basic blur filter. The number of pixels that are to be averaged when performing a Gaussian blur is proportional to the radius, more particularly, the standard deviation of the Gaussian distribution; therefore, the amount of time required to perform a Gaussian blur increases as the radius increases.
This is especially apparent when trying to highlight the foreground of an image by blurring out the background. In these cases, a radius of more than 100 pixels is not unusual, which is 100 times as slow a one pixel-radius blur. One solution to this problem is scaling an image down to a smaller size, applying the blur to the scaled down image and returning the image to the original size. Utilizing algorithms that scale an image down and back up after a blur is performed is significantly faster than simply applying a Gaussian blur. A downscaling algorithm provides a low-pass filtering and the composition of a downscale/Gaussian blur/upscale gives an acceptable approximation of the original full-size Gaussian blur. To accomplish this, the radius needed to be applied is R/S where “R” is the radius and “S” is the scaling. For example, scaling each dimension by ¼ applies ¼ the radius over 1/16 as many pixels. The scaling is determined in a quality/performance case to keep the quality difference small and the downscaling factor (as a low-pass factor) should be chosen in accordance with the band-width of the original blur convolution filter.
In a standard Gaussian blur, a table of Gaussian blur weights is recalculated whenever the radius is changed, therefore, a lot of work is done on each adjustment of the radius. One way to overcome recalculating weights is to have a predetermined radius.
Currently, computation of a Gaussian blur utilizing the scaling feature is performed solely through software on a central processing unit (“CPU”). The software contains code that is designed to scale an image down, code that is designed to perform a blur, and code that is designed to return the image to original size. The codes, as they exist today, are run one after the other and are very time consuming when implemented on the CPU by software.
The deficiencies described above are overcome by providing a method for applying a blur using a graphic processing unit (“GPU”). By taking advantage of the speed and ability the GPU has to offer, the present invention allows a user to perform a blur very quickly without losing a significant amount of quality.
In an embodiment, a method is provided for applying a blur to an image using a GPU. The method comprises instructing the GPU to scale the image down from an original size and instructing the GPU to blur the scaled down image. The method further comprises instructing the GPU to return the blurred image to the original size.
In another embodiment, a method is provided for applying a blur to an image using a GPU. The method comprises instructing the GPU to scale the image down from an original size and instructing the GPU to blur the scaled down image. The method further comprises blurring the scaled down image according to a predetermined radius that is related to a pixel and instructing the GPU to return the blurred scaled down image to the original size.
In yet another embodiment, a method is provided for applying a Gaussian blur to an image using a GPU. The method comprises instructing the GPU to scale the image down from an original size using a GPU's vertex shader module and blurring the scaled down image using a pixel shader module. The method further comprises blurring the scaled down image according to a predetermined radius that is related to a pixel and instructing the GPU to return the scaled down image to the original size using the vertex shader module. Finally, the method further comprises presenting the image to a user.
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 as an aid in determining the scope of the claimed subject matter.
The present invention is described in detail below with reference to the attached drawing figures, wherein:
The subject matter of the present invention is described with specificity to meet statutory requirements. However, the description itself is not intended to limit the scope of this patent. Rather, the inventors have contemplated that the claimed subject matter might also be embodied in other ways, to include different steps or combinations of steps similar to the ones described in this document, in conjunction with other present or future technologies. Moreover, although the term “step” may be used herein to connote different elements of methods employed, the term should not be interpreted as implying any particular order among or between various steps herein disclosed unless and except when the order of individual steps is explicitly described. Further, the specific features are described in detail below with reference to the attached drawing figures, which are incorporated in their entirety by reference herein.
The present invention provides an improved method for the presentation of items on a computer. An exemplary operating environment for the present invention is described below.
The invention may be described in the general context of computer code or machine-useable instructions, including computer-executable instructions such as program modules, being executed by a computer or other machine, such as a personal data assistant or other handheld device. Generally, program modules including routines, programs, objects, components, data structures, etc., refer to code that performs particular tasks or implements particular abstract data types. The invention may be practiced in a variety of system configurations, including hand-held devices, consumer electronics, general-purpose computers, more specialty computing devices, etc. The invention may also be practiced in distributed computing environments where tasks are performed by remote-processing devices that are linked through a communications network.
With reference to
Computing device 100 typically includes a variety of computer-readable media. By way of example, and not limitation, computer-readable media may comprise Random Access Memory (RAM); Read Only Memory (ROM); Electronically Erasable Programmable Read Only Memory (EEPROM); flash memory or other memory technologies; CDROM, digital versatile disks (DVD) or other optical or holographic media; magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, carrier wave or any other medium that can be used to encode desired information and be accessed by computing device 100.
Memory 112 includes computer-storage media in the form of volatile and/or nonvolatile memory. The memory may be removable, nonremovable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical-disc drives, etc. Computing device 100 includes one or more processors that read data from various entities such as memory 112 or I/O components 120. Presentation component(s) 116 present data indications to a user or other device. Exemplary presentation components include a display device, speaker, printing component, vibrating component, etc.
I/O ports 118 allow computing device 100 to be logically coupled to other devices including I/O components 120, some of which may be built in. Illustrative components include a microphone, joystick, game pad, satellite dish, scanner, printer, wireless device, etc.
As previously mentioned, the current invention relates to an improved interface for the presentation of items on a computer. An item may be any piece of content displayable to a user or any piece of content having a graphical representation that may be displayed to a user. For example, an item may be a digital image, a grouping of letters or symbols (e.g., a word) or a file having an associated icon or thumbnail views.
Currently, an interpolation is applied to an image only utilizing a CPU. Software supplies code to the CPU that is designed to scale an image down, code that is designed to perform a blur, and code that is designed to return the image to its original size. The software implementation that is well known in the art is very time consuming. The concept behind utilizing a GPU in embodiments of the present invention is to take full advantage of the inherent strengths of the GPU. Scaling is an inherent capability of the GPU, therefore, the GPU is very good at rescaling images. Performing operations on pixels is also an inherent capability of the GPU; therefore, the GPU is very good at tasks such as blurring an image. A GPU is not the same as a CPU. Unlike the software code used for scaling images with the CPU, in an embodiment, virtually no software code is required for scaling images using the GPU. Software supplies code to the GPU instructing the GPU to scale a certain image by a certain factor and the GPU will perform the scaling very quickly. What took the CPU to do in 2-3 seconds, the GPU will do in much less time, e.g., tenths of a second. While GPUs are well known in the art, the usage thereof in embodiments of the present invention is novel.
The hardware included in the system may include memories, processors, and/or Application Specific Integrated Circuits (“ASICs”). Such memory may include a machine-readable medium on which is stored a set of instructions (i.e. software) embodying any one, or all, of the methodologies described herein. Software can reside, completely or at least partially, within this memory and/or within the processor and/or ASICs. For the purposes of this specification, the term “machine-readable medium” shall be taken to include any mechanism that provides (i.e., stores and/or transmits) information in a form readable by a machine (e.g., a computer). For example, a machine-readable medium includes read only memory (“ROM”), random access memory (“RAM”), magnetic disk storage media, optical storage media, flash memory devices, electrical, optical, acoustical, or other form of propagated signals (e.g., carrier waves, infrared signals, digital signals, etc.), etc.
Although the present invention has been described with reference to specific exemplary embodiments, it will be evident that various modifications and changes may be made to these embodiments without departing from the broader spirit and scope of the invention. Accordingly, the specification and drawings are to be regarded in an illustrative rather than a restrictive sense.