US 7171057 B1 Abstract Systems and techniques for blending image data such that noise, texture and/or high-frequency data may be better preserved in a resulting blended image. In general, in one implementation, the techniques include blending a first image and a second image to form a blended image including a blended image component formed by a non-affine interpolation of components from the first and second images. The techniques also include blending a first image component corresponding to a first image region with a second image component corresponding to a second image region to produce a first blended component, blending a third image component corresponding to the first image region with a fourth image component corresponding to the second image region using blend coefficients, which sum to a value other than one, to produce a second blended component, and merging the first blended component with the second blended component to produce a blended image region.
Claims(22) 1. A method comprising:
blending a first image component corresponding to a first image region with a second image component corresponding to a second image region to produce a first blended component;
blending a third image component corresponding to the first image region with a fourth image component corresponding to the second image region using blend coefficients, which sum to a value other than one, to produce a second blended component; and
merging the first blended component with the second blended component to produce a blended image region.
2. The method of
3. The method of
4. The method of
5. The method of
6. The method of
generating the first smooth data values using pixel values associated with the first image region; and
subtracting the first smooth data values from data values in the first image region to generate the first noise data values.
7. The method of
8. The method of
selecting a random pixel value from a neighborhood of pixels associated with the current pixel in the first image region; and
subtracting from the random pixel value a smooth value from the first smooth data values, the smooth value corresponding to the current pixel in the first image region, to generate a noise value.
9. The method of
10. The method of
11. The method of
generating the first noise data values using pixel values associated with the first image region; and
subtracting the first noise data values from data values in the first image region to generate the first smooth data values.
12. A software product tangibly stored on a machine-readable medium, the software product comprising instructions operable to cause a programmable processor to perform operations comprising:
blending a first image component corresponding to a first image region with a second image component corresponding to a second image region to produce a first blended component;
blending a third image component corresponding to the first image region with a fourth image component corresponding to the second image region using blend coefficients, which sum to a value other than one, to produce a second blended component; and
merging the first blended component with the second blended component to produce a blended image region.
13. The software product of
14. The software product of
15. The software product of
16. The software product of
17. The software product of
generating the first smooth data values using pixel values associated with the first image region; and
subtracting the first smooth data values from data values in the first image region to generate the first noise data values.
18. The software product of
19. The software product of
selecting a random pixel value from a neighborhood of pixels associated with the current pixel in the first image region; and
subtracting from the random pixel value a smooth value from the first smooth data values, the smooth value corresponding to the current pixel in the first image region, to generate a noise value.
20. The software product of
21. The software product of
22. The software product of
generating the first noise data values using pixel values associated with the first image region; and
subtracting the first noise data values from data values in the first image region to generate the first smooth data values.
Description The present application describes systems and techniques relating to blending of image data, for example, blending of digital image data from one image region with digital image data from another image region. Traditional techniques for blending image regions typically produce a new intensity value, I3, based on two original values, I1 and I2, and a scalar blending parameter, β, which ranges from zero to one. Frequently, the blending function is required to yield I1 when β equals zero and I2 when β equals one, and to produce a continuous range of intermediate intensity values for intermediate values of β. This type of blending is also known as interpolation. For example, a linear interpolation function can be:
The image regions that can be blended with such traditional techniques include image portions from one or more images and images from multiple layers forming a composite image. For example, the Clone Stamp tool in Photoshop® software, provided by Adobe Systems Incorporated of San Jose, Calif., blends a portion of an image with another portion of the same image, or with a portion of another image. Various modes are available for combining data from two image regions, ranging from complete replacement of destination pixels by source pixels to linear and nonlinear techniques for graded combinations of source and destination image regions (e.g., a soft edge on a clone brush). Thus, a transition region can be defined in which the blended image data transitions from entirely source pixel data to entirely destination pixel data, with blended data there between. Blending can also be performed on image data having multiple color components. When mixing data from one image region into another image region, color values typically blend smoothly, but other aspects of the image data may not. For example, noise characteristics of the image regions tend to cancel each other out, thereby creating artifacts in a resulting blended image that the human eye can detect. In the context of the Clone Stamp tool, an apparent halo can be produced around the cloned region, where mismatched noise characteristics are apparent to the eye, such as from noise cancellation. Laplacian blending is a traditional technique that attempts to address noise cancellation issues by breaking the original images up into higher and lower frequency components and blending the higher frequency components over a shorter distance in the transition region. This can be represented by using a blending function:
Moreover, interpolation can be performed in a different space. For example, if a function F maps the image data into another space and a function G is the inverse of F, an interpolation function can work in the space of the mapped data, and a new interpolation function can be as follows:
In general, in one aspect, the invention involves blending a first image and a second image to form a blended image including a blended image component formed by a non-affine interpolation of components from the first and second images. The non-affine interpolation can be a spherical interpolation of components from a first image region and a second image region to form a blended image component in a blended image region. In a related aspect, the invention involves combining a first image region and a second image region to form a blended image region having a neighborhood mean and a neighborhood variance, at each of multiple points in the blended image region, that are linear blends of corresponding neighborhood means and variances from the first and second image regions using a common blending parameter. Combining the first image region and the second image region can involve forming a blended image region having, at each point in the blended image region, a neighborhood mean and a neighborhood variance that are linear blends using the common blending parameter. In another related aspect, the invention involves blending a first image component corresponding to a first image region with a second image component corresponding to a second image region to produce a first blended component, blending a third image component corresponding to the first image region with a fourth image component corresponding to the second image region using blend coefficients, which sum to a value other than one, to produce a second blended component, and merging the first blended component with the second blended component to produce a blended image region. The blend coefficients can be derived from a common blending parameter. The blend coefficients can sum to a value greater than one when both of the blend coefficients are non-zero. The blend coefficients can be such that a sum of squares of the blend coefficients will always equal one. Advantageous implementations of the invention include one or more of the following features. The first, second, third and fourth image components can be obtained using various techniques, the first image component can be first smooth data values for the first image region, the third image component can be first noise data values for the first image region, the second image component can be second smooth data values for the second image region, and the fourth image component can be second noise data values for the second image region. Obtaining the first and third image components can involve generating the first noise data values using pixel values associated with the first image region, and subtracting the first noise data values from data values in the first image region to generate the first smooth data values. Alternatively, obtaining the first and third image components can involve generating the first smooth data values using pixel values associated with the first image region, and subtracting the first smooth data values from data values in the first image region to generate the first noise data values. Using the pixel values associated with the first image region can include, for a current pixel in the first image region, generating an average pixel value from a neighborhood of pixels associated with the current pixel in the first image region. Subtracting the first smooth data values can involve, for a current pixel in the first image region, selecting a random pixel value from a neighborhood of pixels associated with the current pixel in the first image region, and subtracting from the random pixel value a smooth value from the first smooth data values, where the smooth value correspond to the current pixel in the first image region, to generate a noise value. The pixel values associated with the first image region can be boundary pixel values from boundary pixels that lie outside the first image region, and generating the first smooth data values can involve fitting new pixel values to a predefined function using the boundary pixel values as boundary conditions for the predefined function. Moreover, fitting the new pixel values to the predefined function can involve fitting the new pixel values to a polynomial to model the first image region. Implementations of the invention may occur in hardware, firmware, software or a combination of these, and may include instructions in a software product tangibly stored on a machine-readable medium, where the instructions are operable to cause a programmable processor to perform the operations described. The invention can be implemented to realize one or more of the following advantages. Two digital image regions can be blended to produce a resulting image that includes underlying noise/texture characteristics. The blended value at each pixel in a blended region can depend upon neighboring image values. Non-local blending using the techniques described herein can include blending such that a standard deviation of image values and a mean of image values, over a spatial neighborhood around each pixel location, are each respected and incorporated into the resulting blended image region. Moreover, the techniques described can be used in blending other types of data values. Noise artifacts, which are commonly introduced when blending two image regions with traditional blending techniques, can thus be prevented. Moreover, high-frequency image details can be better preserved in a resulting blended image. Thus, noise cancellation issues can be effectively eliminated. The details of one or more embodiments of the invention are set forth in the accompanying drawings and the description below. Other features and advantages of the invention will become apparent from the description, the drawings, and the claims. Like reference symbols in the various drawings indicate like elements. As used herein, image components generally refer to frequency components. An image can be broken into a sum of frequency components (e.g., a sum of high-frequency and a low-frequency components) using one or more of multiple frequency decomposition techniques. Such techniques include traditional frequency decomposition based on low-pass, high-pass, and band-pass filters or Fourier analysis, and also include any decomposition into a sum of components exhibiting different rates of changes. For example, frequency components can be distinguish from each other in terms of the rate of change of the rate of change (i.e. the second derivative of the image data). If we are evaluating an image region which contains a constant gradient of colors (color values are linearly increasing across the region) then this would be considered as a low frequency component, since it has a small (namely zero) absolute magnitude of the second derivative. On the other hand, the rate of change of values may be high in this region, and so it may be considered high frequency. Another approach is to produce the “low frequency” component by smoothing the image, either with a Gaussian blur or any other noise-removal or noise-reducing algorithm, such as curvature-based diffusion or median filter. The “high frequency” component, the difference between the original image and the “low frequency” component, is then an estimate of the noise in the image. Note that this version of the “low frequency” image may actually have sharp edges and hence contain high spatial frequencies. When generating the image components, each image component can be generated independent of other image components; alternatively, the generation of one image component can be made to depend on that of other image components. When two image regions are to be blended together, each image region can have two extracted image components, one of which can be calculated directly from the image data, and the other of which can be calculated based on the image data and the directly calculated component. For example, a directly calculated component can be a high spatial frequency filtered version of the corresponding image region, and the indirectly calculated component can be the difference between the high frequency version and the original image. The image component generation and blending operations can be adjusted and/or intermixed in order to reduce processing time; for example, an indirectly calculated component can be implicitly calculated during the blend. Moreover, the extracted image components can both be calculated directly. First and second image components are blended together to produce a first blended component at For at least one value of an input blending parameter (e.g., a blending parameter received as input, such as from software or a user), the blend coefficients for the third and fourth image components sum to a value other than one. The blend coefficients can be made to sum to a value greater than one when both of the blend coefficients are non-zero. For example, a sum of squares of the blend coefficients can equal one for all possible blend coefficients, given a range of possible blending parameters as input. The blending mask In general, as shown in Most blending or interpolation functions at some point perform a weighted sum. The summed values may be processed relative to the inputs to the blending formula and the derivation of the weights relative to the blending parameter may be complicated. Considering the set of valid weights as points in space (2-dimensional space for two-input blending, 3-dimensional space for 3-input blending, etc.), then affine blending functions have, as shown in the examples of To improve noise characteristics of a resulting blended image, a first image region and a second image region can be combined to form a blended image region that has a neighborhood mean and a neighborhood variance that are linear blends of corresponding neighborhood means and neighborhood variances from the first and second image regions. A common blending parameter can be used. For example, at each pixel in the blended region, a neighborhood mean and a neighborhood variance can be linear blends, of the neighborhood mean and the neighborhood variance of the source image regions, using a common blending parameter. By blending pixel values in such a way as to preserve mean and variance characteristics of the two source images, noise characteristics of the resulting blended image can be improved. The recombined image can be made to look to the eye like a linear interpolation of both the average values and the variance values of the source images, and as a result, the eye is not drawn to the transition region. Noise is a non-local property of an image. As used herein, the term noise includes high-frequency image data that actually corresponds to the abstract image being represented (e.g., eyelashes, grass or other actual high-frequency image details), film grain, and other image texture that may not generally be thought of as noise. Variance in image values over a spatial region in an image is generally a good measure of image noise. Thus, the squared standard deviation (SSD) is a useful measure of image noise which captures second order correlations among pixels. When the SSD of image values, taken over the spatial neighborhood around a pixel location, and the mean image value for the neighborhood are taken into account in the image blending, the resulting blended image region can more accurately represent noise characteristics of the two source image regions. The example techniques described herein for respecting the neighborhood variance of image values during blending are presented in the context of splitting a source image region up into two components: a non-noise component and a noise component. The non-noise component generally includes lower-frequency aspects of the image data. These lower-frequency aspects are described as smooth data values, although they need not be smooth in an absolute sense. The noise component generally includes higher-frequency aspects of the image data. These higher-frequency aspects are described as noise data values, although they can include image aspects that actually correspond to the underlying abstract image (e.g., high-frequency image details) or to noise-like image aspects (e.g., film grain). In alternative implementations, the image data can be split up into more than two image components. A source image region can be split into several frequency levels, and blending can proceed in an iterative fashion on these multiple levels, using the techniques described herein, before combining the blended levels to form the final blended image region. A variety of affine and non-affine interpolations can be used with the different levels in the image decomposition. For example, a linear interpolation can be used for the lowest-frequency component(s), a spherical interpolation can be used for the highest-frequency component(s), and intermediate functions can be used for the intervening component(s). Given two source image regions, I1 and I2, four different image components can be obtained: (1) a non-noise component I1 These components can then be blended together to form a blended image region I3 as follows:
If the noise components of the source images, I1 and I2, are correlated, a resulting noise component of the blended image may not vary smoothly from the noise component of I1 to the noise component of I2 as the blending parameter, β, varies from zero to one. In this case, a decorrelation operation can be performed to reduce correlation before blending. For example, I1 A non-noise component I The image The neighborhood Such generation of new pixel values, which then constitute the smooth data values for the image region Once smooth data values have been calculated for an image region, the noise data values can be obtained by subtracting the smooth data values from the original image values in the image region. Alternatively, the noise data values can be calculated directly, and the smooth data values can either be calculated directly or obtained by subtracting the noise data values from the original data values. The noise data values can be calculated directly as the Laplacian of the image or as a power of the Laplacian:
Regardless of the techniques used to generate the smooth data values, when the noise data values are obtained by subtracting the smooth data values from the original image values, a stochastic selection technique can be used to obtain the noise data values. Referring again to This introduction of a stochastic element to the noise determination can avoid problems that can be created by correlations between the source images and can result in a more natural looking blend. In the context of image cloning, which involves a blended copy of one image region into another, this introduction of randomness can help to reduce correlation artifacts that can otherwise be introduced in the copying process. Special attention should be paid to the cases where the blend parameter is zero or one in order to get the appropriate original image values. When using this stochastic approach, it may be preferable to not use the mean or median image values as the smooth data values. Moreover, this stochastic approach may be undesirable when the disclosed techniques are used to preserve high-frequency image details. The invention can be implemented in digital electronic circuitry, or in computer hardware, firmware, software, or in combinations of them. Apparatus of the invention can be implemented in a software product (e.g., a computer program product) tangibly embodied in a machine-readable storage device for execution by a programmable processor; and processing operations of the invention can be performed by a programmable processor executing a program of instructions to perform functions of the invention by operating on input data and generating output. The invention can be implemented advantageously in one or more software programs that are executable on a programmable system including at least one programmable processor coupled to receive data and instructions from, and to transmit data and instructions to, a data storage system, at least one input device, and at least one output device. Each software program can be implemented in a high-level procedural or object-oriented programming language, or in assembly or machine language if desired; and in any case, the language can be a compiled or interpreted language. Suitable processors include, by way of example, both general and special purpose microprocessors. Generally, a processor will receive instructions and data from a read-only memory, a random access memory and/or a machine-readable signal (e.g., a digital signal received through a network connection). Generally, a computer will include one or more mass storage devices for storing data files; such devices include magnetic disks, such as internal hard disks and removable disks, magneto-optical disks, and optical disks. Storage devices suitable for tangibly embodying software program instructions and data include all forms of non-volatile memory, including by way of example semiconductor memory devices, such as EPROM (electrically programmable read-only memory), EEPROM (electrically erasable programmable read-only memory), and flash memory devices; magnetic disks such as internal hard disks and removable disks; magneto-optical disks; and CD-ROM disks. Any of the foregoing can be supplemented by, or incorporated in, ASICs (application-specific integrated circuits). To provide for interaction with a user, the invention can be implemented on a computer system having a display device such as a monitor or LCD (liquid crystal display) screen for displaying information to the user and a keyboard and a pointing device such as a mouse or a trackball by which the user can provide input to the computer system. The computer system can be programmed to provide a graphical user interface through which computer programs interact with users. The invention has been described in terms of particular embodiments. Other embodiments are within the scope of the following claims. Patent Citations
Referenced by
Classifications
Legal Events
Rotate |