A two-dimensional blur kernel is computed for a digital image by first estimating a sharp image from the digital image. The sharp image is derived from the digital image by sharpening at least portions of the digital image. The two-dimensional blur function is computed by minimizing an optimization algorithm that estimates the blur function.
|
14. A device comprising:
a processor and memory, the device configured to perform a process, the process comprising:
acquiring a blurred digital image stored in the memory;
detecting blurred edges in the blurred digital image and estimating corresponding underlying sharp edge lines, stored in the memory, that created the blurred edges when the blurred digital image was captured; and
computing a blur kernel based on the sharp edge lines and the blurred digital image.
1. One or more volatile and/or non-volatile computer-readable media storing information to enable a device to perform a process, the process comprising:
receiving a digital image;
finding continuous two-dimensional blurred edges in portions of the digital image and computing corresponding two-dimensional sharpened edges oriented and located relative to the digital image;
computing a blur kernel based on the two-dimensional sharpened edges; and
applying the blur kernel to the digital image to produce a de-blurred version of the digital image.
2. One or more computer readable media according to
3. One or more computer readable media according to
4. One or more computer readable media according to
5. One or more computer readable media according to
6. One or more computer readable media according to
7. One or more computer readable media according to
8. One or more volatile and/or non-volatile computer-readable media according to
9. One or more volatile and/or non-volatile computer-readable media according to
10. One or more volatile and/or non-volatile computer-readable media according to
11. One or more volatile and/or non-volatile computer-readable media according to
12. One or more volatile and/or non-volatile computer-readable media according to
13. One or more volatile and/or non-volatile computer-readable media according to
15. A device according to
16. A device according to
17. A method according to
18. A device according to
19. A device according to
|
Image blur can be introduced in a number of ways when a camera is used to capture an image. Image blur can have various causes, such as movement of the camera or the subject being photographed, incorrect focus, or inherent features of the camera, such the camera's pixel size, the resolution of the camera's sensor, or its use of anti-aliasing filters on the sensor.
However, recovering a blur kernel from a single blurred image is an inherently difficult problem due to the loss of information during blurring. The observed blurred image provides only a partial constraint on the solution, as there are many combinations of blur kernels and sharp images that can be convolved to match the observed blurred image.
Techniques related to finding a blur kernel of an image are discussed below.
The following summary is included only to introduce some concepts discussed in the Detailed Description below. This summary is not comprehensive and is not intended to delineate the scope of the claimed subject matter, which is set forth by the claims presented at the end.
A two-dimensional blur kernel is computed for a digital image by first estimating a sharp image from the digital image. The sharp image is derived from the digital image by sharpening at least portions of the digital image. The two-dimensional blur function is computed by minimizing an optimization algorithm that estimates the blur function.
Many of the attendant features will be explained below with reference to the following detailed description considered in connection with the accompanying drawings.
Overview
Embodiments discussed below relate to blur estimation. More specifically, a sharp image may be estimated from a blurry input image. The sharp image can be used to recover a blur kernel. With certain types of image blur, image features such as edges, though weakened by blur, can be detected. Even in a blind scenario where the scene content of the blurred image is unknown, if it is assumed that a detected blurred edge would have been a step edge absent any blurring effects, it is possible to detect likely edges in the blurred image and then predict or estimate the locations in the blurred image of the corresponding sharp edges of the scene. Each estimated/computed edge and its corresponding blurred edge provides information about a radial profile of the blur kernel. If an image has edges with a sufficient span of orientations, the blurred image and its predicted sharp image may contain sufficient information to solve for a general two-dimensional blur kernel.
Before further explaining techniques for estimating a blur kernel, consider that a blur kernel is usually a two-dimensional image or array of numbers which when convolved (repeated multiplication and summation-stepped over the pixels of the image) with the desired sharp/true image produces what was seen or imaged. Although blur may be caused by a number of cumulative factors such as motion, defocus, anti-aliasing, etc., these effects can be combined into a single kernel because the convolution of multiple blur kernels result in a single cumulative blur kernel. Convolution and de-convolution will be discussed further with reference to
Image Formation Model
One embodiment for finding blur kernel 182 involves estimating a discretely sampled version of the model's continuous PSF by either matching the sampling to the image resolution (useful for estimating large blur kernels) or by using a sub-pixel sampling grid to estimate a detailed blur kernel 182 (which can capture sensor aliasing and allow high accuracy image restoration). Also, by computing a sub-pixel blur kernel 182, it is possible to recover a super-resolved de-blurred image by deconvolving an up-sampled image with the recovered blur kernel 182.
Regarding the geometric transformations 180, this world-to-image transformation consists of a perspective transform and a radial distortion. When using mainly the blurred image 132 to recover the blur kernel 182 (referred to herein as the blind method), the perspective transform is ignored; computation is in image coordinates. When a “true” version of the blurred image 132 (e.g., a computed or captured grid pattern or calibration target) is to be used to recover the blur kernel (referred to as the non-blind method), the perspective transformation is modeled as a two-dimensional homography that maps known feature locations Fk on t a grid pattern to detect feature points from the image Fd. In this case, a standard model for radial distortion is used: (F′x, F′y)T=(Fx, Fy)T(a0+a1r2(x, y)+a2r4(x, y)), where r(x, y)=(Fx2+Fy2)1/2 is the radius relative to the image center. The zeroth, second and fourth order radial distortion coefficients a0, a1, and a2 specify the amount and type of radial distortion.
Given a radial distortion function R(F) and warp function which applies a homography H(F), the full alignment process is Fd=R(H(Fk)). The parameters that minimize the L2 norm of the residual ∥Fd−R(H(Fk))∥2 are computed. It may not be possible to compute these parameters simultaneously in closed form. However, the problem is bilinear and the parameters can be solved-for using an iterative optimization approach.
Regarding modeling of the blur kernel 182, the equation for an observed image B is a convolution of a kernel K and a potentially higher-resolution sharp image I, plus additive Gaussian white noise, whose result is potentially down-sampled:
B=D(IK)+N, (1)
where N˜N(0, σ2). D(I) down-samples an image by point-sampling IL(m, n)=I(sm, sn) at a sampling rate s for integer pixel coordinates (m, n). With this formulation, the kernel K can model most blurring effects, which are potentially spatially varying and wavelength dependent.
Sharp Image Estimation
As seen above, blurring can be formulated as an invertible linear imaging system, which models the blurred image as the convolution of a sharp image with the imaging system's blur kernel. Thus, if the original sharp image is known, the kernel can be recovered. Therefore, when the original sharp image is not available (the blind case) it is helpful to have a reliable and widely applicable method for predicting or estimating a sharp image from a single blurry image. The following two sections (BLIND ESTIMATION, NON-BLIND ESTIMATION) discuss predicting or estimating a sharp image. The next section (BLUR KERNEL ESTIMATION) shows how to formulate and solve the invertible linear imaging system to recover the blur kernel. For simplicity, blurred images are considered to be single channel or grayscale. A later section (CHROMATIC ABERRATION) discusses handling color images.
Blind Estimation
To explain blind estimation further, when only a blurred image may be available for finding a blur kernel, blur is assumed to be due to a PSF with a single mode (or peak), such that when an image is blurred, the ability to localize a previously sharp edge is unchanged. However, the strength and profile of the edge is changed (see sharp edge 204 in graph 202). Thus, by localizing blurred edges and predicting sharp edge profiles, estimating a sharp image is possible.
Edge estimation may be based on the assumption that observed blurred edges result from convolving an ideal step edge with the unknown blur kernel 205. The location and orientation of blurred edges in the blurred image may be found using a sub-pixel difference-of-Gaussians edge detector. An ideal sharp edge may then be predicted by finding the local maximum and minimum pixel values (e.g., pixel values 206, 208), in a robust way, along the edge profile (e.g., profile 200). These values are then propagated from pixels on each side of an edge to the sub-pixel edge location. The pixel at an edge itself is colored according to the weighted average of the maximum and minimum values according to the distance of the sub-pixel location to the pixel center, which is a simple form of anti-aliasing (see graph 202 in
The maximum and minimum values may be found robustly using a combination of two techniques. The maximum value may be found by marching along the edge normal, sampling the image to find a local maximum using hysteresis. Specifically, the maximum location may be deemed to be the first pixel that is less than 90% of the previous value. Once this value and location are identified, the maximum value is stored as the mean of all values along the edge profile that are within 10% of the initial maximum value. An analogous approach is used to find the minimum pixel value.
Because values can be most reliably predicted near edges, it may be preferable to use only observed pixels within a given radius of the predicted sharp values. These locations are stored as valid pixels in a mask, which is used when solving for the blur kernel. At the end of this sharp image prediction/estimation process the result is a partially estimated sharp image such as sharp image 136 in
It should be noted that it may not be possible to predict sharp edges throughout the entire blurred image 132. Therefore, the sharp image may be a partial estimation comprised of sharpened patches or regions of the blurred image. It should also be noted that other techniques for predicting the sharp image are known and can be used instead of the difference-of-Gaussians technique discussed above. For example, the Marr-Hildreth algorithm may be used to detect sharp edges.
Non-Blind Estimation
Non-blind sharp edge prediction may be used when the blurred image's true sharp image is known. This approach is typically used in a controlled lab setup.
For non-blind sharp image prediction, it is again assumed (though not required) that the kernel has no more than a single peak. Thus even when the pattern is blurred, it is possible to detect corners on the grid with a sub-pixel corner detector. Because the corners of pattern 220 are actually balanced checkerboard crossings (radially symmetric), they do not suffer from “shrinkage” (displacement) due to blurring. Once the corners are found, the ground truth pattern 220 is aligned to the acquired image 222 of the pattern 220. To obtain an accurate alignment, both geometric and radiometric aspects of the imaging system may be corrected for. Geometric alignment may be performed using the corrections discussed earlier. A homography and radial distortion correction may be fitted to match the known feature locations on the grid pattern to corners detected with sub-pixel precision on the acquired (blurry) image of the printed grid.
Lighting and shading in the image 222 of the grid pattern 220 may also be accounted for by first aligning the known grid pattern 220 to the image 222. Then, for each edge location (as known from the mathematical form of the ground truth grid pattern), the maximum and minimum values on the edge profile are found and propagated as in the non-blind approach. The grid for pixels is shaded within the blur radius of each edge. By performing the shading operation, it is possible to correct for shading, lighting, and radial intensity falloff. Image 224 in
Blur Kernel Estimation
Having estimated a sharp image, the PSF can be estimated as the kernel that when convolved with the sharp image produces the blurred input image. The estimation can be formulated using a Bayesian framework solved using a maximum a posteriori (MAP) technique. MAP estimation is used to find the most likely estimate for the blur kernel K given the sharp image I and the observed blurred image B, using the previously-discussed known image formation model and noise level. This can be expressed as a maximization over the probability distribution of the posterior using Bayes' rule. The result is minimization of a sum of negative log likelihoods L(.):
The problem is now reduced to defining the negative log likelihood terms. Given the image formation model (Equation 1), the data term is:
L(B|K)=∥M(B)−M(IK)∥2/σ2. (4)
Note that the downsampling term D in (1) may be incorporated when computing a super-resolved blur kernel, as discussed later.
The function M(.) in Formula (4) is a masking function such that this term is only evaluated for “known” pixels in B, i.e., those pixels that result from the convolution of K with properly estimated pixels I, which form a band around each edge point, as described in the BLIND ESTIMATION section above.
The remaining negative log likelihood term, L(K), models prior assumptions on the blur kernel and regularizes the solution. A smoothness prior and a non-negativity constraint are used. The smoothness prior penalizes large gradients and thus biases kernel values to take on values similar to their neighbors: Ls(K)=γλ∥∇K∥2, where λ controls the weight of the smoothness penalty, and γ=(2R+1)2 normalizes for the kernel area (R is the kernel radius). Since the kernel should sum to one (as blur kernels are energy conserving) the individual values decrease with increased R. This factor keeps the relative magnitude of kernel gradient values on par with the data term values regardless of kernel size. The following error function is therefore minimized (subject to Ki≧0) to solve for the PSF (blur kernel) using non-negative linear least squares using a projective gradient Newton's method:
L=∥M(B)−M(IK)∥2/σ2+γλ∥∇K∥2 (5)
The noise level can be estimated using a technique similar to that of C. Liu et al. (“Noise estimation from a single image”, CVPR '06, volume 2, pages 901-908, June 2006). Empirically, λ=2 works well.
Super-Resolved Blur Kernel
By taking advantage of sub-pixel edge detection for blind prediction or sub-pixel corner detection for non-blind prediction, it is possible to estimate a super-resolved blur kernel by predicting a sharp image at a higher resolution than the observed blurred image.
For the blind method, in the process of estimating the sharp image, the predicted sharp edge-profile is rasterized back onto a pixel grid. By rasterizing the sub-pixel sharp-edge profile onto an up-sampled grid, a super-resolved sharp image can be estimated. In addition, at the actual identified edge location (as before), the pixel color is a weighted average of the minimum and maximum, where the weighting reflects the sub-pixel edge location on the grid. For the non-blind method, the grid pattern is also rasterized at a desired resolution. Since corners are detected at sub-pixel precision, the geometric alignment is computed with sub-pixel precision. Using the mathematical description of the grid, any upsampled resolution can be chosen when rasterizing the predicted sharp image. Anti-aliasing may also be performed, as described earlier.
To solve for the blur kernel using the super-resolved predicted sharp image IH and the observed (vectorized) blurry image b, Equation 4 may be modified to include a down-sampling function according to the image model (Equation 1). Also, bH=AHkH is considered to be a super-resolved sharp image blurred by the super-resolved kernel kH, where AH is the matrix form of IH. Equation 4 is then ∥b−DAHkH∥2 (the masking function has been left out for readability). D is a matrix reflecting the down-sampling function: {circumflex over (B)}L(m, n)={circumflex over (B)}H(sm, sn).
Computing a Spatially Varying PSF
Given the formulation above, a spatially varying PSF can be computed in a straightforward manner by performing the MAP estimation process described in the previous section for sub-windows of the image. The process operates on any size sub-window as long as enough edges at different orientations are present in that window. In the limit, a PSF can be computed for every pixel using sliding windows. In practice it was found that such a dense solution is not necessary, as the PSF tends to vary spatially relatively slowly.
For reliable results, this method benefits from having sufficient edges at most orientations. When using the entire blurred image, this is not usually an issue. However, when using smaller windows or patches, the edge content may under-constrain the PSF solution. A simple test may be used to avoid this problem: ensure that (a) the number of valid pixels in the mask described in Equation 4 is greater than the number of unknowns in the kernel, and (b) compute a histogram of 10 degree bins of the detected edges orientations and ensure that each bin contains at least a minimum number of edges (experimentation has shown that a minimum value of 100 is effective, but other values could be used). When this check fails, a kernel for that window is not computed.
Chromatic Abberation
The previous sections did not explicitly address solving blur kernels for color images. To handle color, the blurred image can be simply converted to grayscale. In many cases this is sufficient. However, it is usually more accurate to solve for a blur kernel for each color channel. This need may arise when chromatic aberration effects are apparent.
Due to the wavelength-dependent variation of the index of refraction of glass, the focal length of a lens varies continually with wavelength. This property causes longitudinal chromatic aberration (blur/shifts along the optical axis), which implies that the focal depth, and thus amount of defocus, is wavelength dependent. This also causes lateral chromatic aberration (blur/shifts perpendicular to the optical axis).
By solving for a blur kernel per color channel, the longitudinal aberrations can be modeled using a per-color channel radial distortion correction to handle the lateral distortions. Lateral distortions can be corrected by first performing edge detection on each color channel independently and only keeping edges that are detected within 5 pixels of each other in R, G, and B. A radial correction is then computed to align the R and B edges to the G edges and then perform blind sharp image prediction.
To correct for any residual radial shifts, the green edge locations are used for all color channels so that all color bands have sharp edges predicted at the same locations. This last step could be performed without correcting radial distortion first and by allowing the shifts to be entirely modeled within the PSF; however, the two stage approach has been found to be superior, as it removes some aberration artifacts even when there is not enough edge information to compute a blur kernel. By removing the majority of the shift first, it is possible to solve for smaller kernels.
If RAW camera images are available, more accurate per-channel blur kernels can be computed by accounting for the Bayer pattern sampling during blur kernel computation instead of using the demosaiced color values. A blur kernel is solved at the original image resolution, which is 2× the resolution for each color channel. The point sampling function discussed above may be used, where the sampling is shifted according to the appropriate Bayer sample location.
Embodiments and features discussed above can be realized in the form of information stored in volatile or non-volatile computer or device readable media. This is deemed to include at least media such as optical storage (e.g., CD-ROM), magnetic media, flash ROM, or any current or future means of storing digital information. The stored information can be in the form of machine executable instructions (e.g., compiled executable binary code), source code, bytecode, or any other information that can be used to enable or configure computing devices to perform the various embodiments discussed above. This is also deemed to include at least volatile memory such as RAM and/or virtual memory storing information such as CPU instructions during execution of a program carrying out an embodiment, as well as non-volatile media storing information that allows a program or executable to be loaded and executed. The embodiments and featured can be performed on any type of computing device, including portable devices, workstations, servers, mobile wireless devices, and so on. The embodiments can also be performed in digital cameras or video cameras, given sufficient CPU capacity.
Szeliski, Richard, Joshi, Neel, Zitnick, Charles Lawrence
Patent | Priority | Assignee | Title |
10706562, | Mar 30 2015 | Carl Zeiss Industrielle Messtechnik GmbH | Motion-measuring system of a machine and method for operating the motion-measuring system |
11336819, | Jun 18 2015 | The Nielsen Company (US), LLC | Methods and apparatus to capture photographs using mobile devices |
8249357, | Oct 23 2006 | BEN GURION UNIVERSITY OF THE NEGEV RESEARCH AND DEVELOPMENT AUTHORITY | Blind restoration of images degraded by isotropic blur |
8411980, | Nov 12 2010 | Adobe Inc | Removing motion blur from unaligned multiple blurred images |
8571308, | Sep 15 2008 | TELEFONAKTIEBOLAGET LM ERICSSON PUBL | Image processing for aberration correction |
8923644, | Mar 29 2010 | Samsung Electronics Co., Ltd. | Image processing apparatus and systems using estimated point spread function |
Patent | Priority | Assignee | Title |
6259822, | Oct 30 1998 | Monument Peak Ventures, LLC | Edge enhancement which reduces the visibility of false contours |
6611627, | Apr 24 2000 | Monument Peak Ventures, LLC | Digital image processing method for edge shaping |
7260270, | Sep 28 2000 | Nikon Corporation | Image creating device and image creating method |
7616826, | Jul 28 2006 | Massachusetts Institute of Technology; University of Toronto | Removing camera shake from a single photograph using statistics of a natural image |
7719719, | Sep 18 2006 | Xerox Corporation | Sharpening a halftoned image |
20050265621, | |||
20060110147, | |||
20060125938, | |||
20060279639, | |||
20070009169, | |||
20070058073, | |||
20070217713, | |||
20110090352, |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Jun 23 2008 | Microsoft Corporation | (assignment on the face of the patent) | / | |||
Sep 02 2008 | SZELISKI, RICHARD | Microsoft Corporation | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 022073 | /0846 | |
Sep 02 2008 | ZITNICK, CHARLES LAWRENCE | Microsoft Corporation | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 022073 | /0846 | |
Sep 04 2008 | JOSHI, NEEL | Microsoft Corporation | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 022073 | /0846 | |
Oct 14 2014 | Microsoft Corporation | Microsoft Technology Licensing, LLC | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 034564 | /0001 |
Date | Maintenance Fee Events |
Sep 02 2015 | M1551: Payment of Maintenance Fee, 4th Year, Large Entity. |
Sep 05 2019 | M1552: Payment of Maintenance Fee, 8th Year, Large Entity. |
Nov 06 2023 | REM: Maintenance Fee Reminder Mailed. |
Apr 22 2024 | EXP: Patent Expired for Failure to Pay Maintenance Fees. |
Date | Maintenance Schedule |
Mar 20 2015 | 4 years fee payment window open |
Sep 20 2015 | 6 months grace period start (w surcharge) |
Mar 20 2016 | patent expiry (for year 4) |
Mar 20 2018 | 2 years to revive unintentionally abandoned end. (for year 4) |
Mar 20 2019 | 8 years fee payment window open |
Sep 20 2019 | 6 months grace period start (w surcharge) |
Mar 20 2020 | patent expiry (for year 8) |
Mar 20 2022 | 2 years to revive unintentionally abandoned end. (for year 8) |
Mar 20 2023 | 12 years fee payment window open |
Sep 20 2023 | 6 months grace period start (w surcharge) |
Mar 20 2024 | patent expiry (for year 12) |
Mar 20 2026 | 2 years to revive unintentionally abandoned end. (for year 12) |