Edge Direction and Curve Based Image De-Blurring
An image de-blurring system obtains a blurred input image and generates, based on the blurred input image, a blur kernel. The blur kernel is an indication of how the image capture device was moved and/or how the subject captured in the image moved during image capture. Based on the blur kernel and the blurred input image, a de-blurred image is generated. The blur kernel is generated based on the direction of edges identified in the blurred input image and/or based on curves having a high curvature identified in the image (e.g., corners identified in the image).
Latest ADOBE SYSTEMS INCORPORATED Patents:
As digital imaging technology has advanced, the use of digital cameras has expanded to where digital imaging can be found not only in dedicated cameras but also in various other devices such as computers, wireless phones, and so forth. While this advance in digital imaging technology has made it easier for users to take pictures using a variety of different devices, problems still remain. One such problem is that image blurring can still occur, oftentimes caused by movement of the camera while capturing the image. Such image blurring can result in frustrating user experiences as the picture the user intended to capture is not as sharp as the user was expecting or desired.
SUMMARYThis Summary introduces a selection of concepts in a simplified form that are further described below in the Detailed Description. As such, this Summary is not intended to identify 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.
In accordance with one or more aspects, an input image is obtained and, using a direction of each of multiple edges identified in the input image, one or more of the multiple edges are selected. Using the selected one or more edges, a blur kernel is generated based on which a de-blurred version of the input image is generated.
In accordance with one or more aspects, an input image is obtained and an indication of one or more curves in the input image is received. Each of the one or more curves has an angle within a threshold amount of a right angle in the input image. Using the indicated one or more curves, a blur kernel is generated based on which a de-blurred version of the input image is generated.
The detailed description is described 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 instances in the description and the figures may indicate similar or identical items. Entities represented in the figures may be indicative of one or more entities and thus reference may be made interchangeably to single or plural forms of the entities in the discussion.
Edge direction and curve based image de-blurring is discussed herein. An image de-blurring system obtains a blurred input image and generates, based on the blurred input image, a blur kernel. The blur kernel is an indication of how the image capture device was moved (and/or how the subject captured in the image moved) during image capture, resulting in blur. Based on the blur kernel and the blurred input image, a de-blurred image is generated.
The blur kernel can be generated based on the direction of edges identified in the blurred input image. Such a blur kernel is generated by identifying edge directions of the pixels of edges identified in the blurred input image. The pixels are assigned to different groups based on their edge directions, and ones of these pixels are selected so that approximately the same number of pixels in each of the different groups is selected. The selected pixels are the basis for generating the blur kernel, resulting in a blur kernel that reflects the various edge directions associated with the different groups.
The blur kernel can additionally or alternatively be generated based on curves having a high curvature in the image (e.g., corners in the image). Curves having a high curvature in the image are identified, and ones of these identified curves are selected as the basis for generating the blur kernel. The blur kernel is generated based on these selected curves, and optionally also based on selected pixels from other edges (e.g., edges that are not curves having a high curvature).
Image de-blurring system 102 processes images to de-blur the images. De-blurring an image refers to reducing the blur present in an image, also referred to as sharpening the image. As illustrated in the example of
Image access module 202 obtains an image 220, also referred to as an input image, for de-blurring. Image 220 is assumed to typically have blurring, and thus is also referred to as a blurred image. Image access module 202 can obtain image 220 in various manners and from various sources, and can obtain the image from another component of the device implementing system 200 or from a separate device. For example, module 202 can obtain the image from an image capture component, retrieve the image from a storage device coupled to the device implementing system 200, retrieve the image from a storage device accessed via a network, and so forth.
Generally, blur kernel generation module 208 generates a blur kernel used in de-blurring the image obtained by image access module 202. The blur kernel, also referred to as a point spread function (PSF), is an indication of how the image capture device was moved (and/or how the subject captured in the image moved) during image capture, resulting in blur as discussed above. How the image capture device (or subject) was moved refers to a direction of movement and an amount (e.g., distance) of movement.
To generate the blur kernel, module 208 analyzes blurred image 220 and selects one or more edges in blurred image 220 and/or one or more curves with high curvature. Given the selected edges and/or curves, module 208 predicts a sharp version of the selected edges and/or curves. Given the predicted sharp version of the selected edges and/or curves and the blurred version of the selected edges and/or curves, module 208 can readily identify the difference between sharp and blurred versions of the selected edges and/or curves, this difference being the blur kernel generated by module 208. The blur kernel is generated based on edges identified in the image and selected by direction-aware edge selection module 204 and/or curves with high curvature identified in the image and selected by curve selection module 206. The blur kernel is used by image generation module 210 to generate de-blurred image 222, which is a de-blurred version of blurred image 220.
Image generation module 210 generates a de-blurred image from a blurred image based on information obtained from the blurred image itself. Module 210 need not have access to metadata or other information describing the image capture process, the image capture device, the subject captured in the image, and so forth. This de-blurring based on information obtained from the blurred image itself is also referred to as single image de-blurring or blind de-convolution.
In process 300, an input image is obtained (act 302). The input image is a blurred image for which a de-blurred version of the image is to be generated. The input image can be obtained from a variety of different sources as discussed above.
One or more of multiple pixels in the input image are selected using an edge direction of each of the multiple pixels (act 304). For example, the pixels can be assigned to various different groups based on edge direction of the pixel, and an adaptive gradient magnitude threshold used to select pixels from the various groups as discussed in more detail below.
One or more curves detected in the input image are selected (act 306). The one or more curves are curves having an angle within a threshold amount of a right angle in the input image (e.g., corners).
A blur kernel is generated using the selected one or more pixels and/or the selected one or more curves (act 308). The blur kernel is generated based on the blurred version of the selected pixels and/or curves as well as predicted sharp versions of the selected pixels and/or curves.
A de-blurred version of the blurred input image is generated using the blur kernel (act 310). The de-blurred version of the image can be readily generated given the blurred input image obtained in act 302 and the blur kernel generated in act 308, as discussed in more detail below.
It should be noted that both acts 304 and 306 can be, but need not be, performed in process 300. Thus, the blur kernel can be generated using the selected one or more pixels without using the selected one or more curves, and the blur kernel can also be generated using the selected one or more curves without using the selected one or more pixels.
The acts of
Although discussed herein with reference to gradient magnitudes, other values can be used for or assigned to pixels of edges. For example, other values that provide a probability or other indication of how likely a particular pixel is to be part of an edge can be used rather than gradient magnitudes. It is to be appreciated that in the techniques discussed herein, such other values can alternatively be used in place of gradient magnitudes.
Pixels are selected in act 304 based on both the gradient magnitude and the edge direction of each pixel in the edge map. It should be noted that pixels are typically selected from all pixels in the edge map, although can alternatively be selected pixels from fewer than all pixels in the edge map. Pixels are selected so that approximately the same number of pixels in each of multiple different edge directions is selected, and an indication of those selected pixels (e.g., identifies the pixels as well as their gradient magnitudes and edge directions) is used to generate the blur kernel in act 308. Thus, because the selection is based on the edge direction of pixels, situations can arise where some of the selected pixels have smaller or lower gradient magnitudes than some pixels that are not selected.
It should be noted that in situations in which each pixel can have an angle from 0 to 180 degrees, an angle of the line representing the edge direction can be used to determine the angle of the pixel. For example, the line representing an angle of 35 degrees would be the same as the line representing an angle of 215 degrees (180+35). Alternatively, each pixel can have an angle from 0 to 360 degrees (e.g., relative to the x axis).
Pixels are selected so that approximately the same number of pixels in each of the multiple different groups is selected (act 406). The pixels can be selected in different manners. In one or more embodiments, different threshold values are used for the gradient magnitudes of the pixels in the different groups. Thus, the techniques discussed herein are also referred to as applying or using an adaptive gradient magnitude threshold. The gradient magnitude threshold for each group is determined so that approximately the same number (e.g., the same number, numbers within a fixed threshold difference (e.g., 150), numbers within a relative threshold difference (e.g., 25%), etc.) of pixels is selected from each group. For each group the pixels having gradient magnitudes that satisfy (e.g., are equal to and/or greater than) the gradient magnitude threshold of that group are selected for use in generating the blur kernel. Thus, pixels are selected based on both their edge directions and their gradient magnitudes, rather than based on their gradient magnitudes alone.
Alternatively, rather than determining gradient magnitude thresholds for each group, a particular number of pixels in each group can be selected. For example, a particular number (e.g., 400) of the pixels in each group that have the largest gradient magnitudes can be selected for use in generating the blur kernel.
Returning to
In one or more embodiments, curves with high curvature are detected by first detecting edges in the image to obtain a binary edge map. The edges can be detected in various manners, such as using a Canny edge detector, and contours of the edges are then extracted using a curvature scale space (CSS) technique. Given the extracted contours, the curvature for each contour is computed at a fixed low scale to retain the true corners, and the local maxima of absolute curvature are regarded as corner candidates. A threshold is adaptively computed according to the mean curvature within a region of support, and round corners are removed by comparing the curvature of corner candidates with the adaptive threshold. The angles of the remaining corner candidates are evaluated based on a dynamically recalculated region of support to eliminate false corners. After eliminating false corners, the end points of open contours in the remaining corner candidates are then considered and kept as corner candidates unless they are very close to (e.g., within a threshold number of pixels of) another corner. The remaining corner candidates after considering end points of open contours are the detected curves.
Returning to
Curves with high curvature can be selected regardless of the edge directions of edges in the curves, or alternatively based on the edge directions of edges in the curves. In one or more embodiments, the curves selected in act 504 are curves with high curvature that include an edge with pixels in a group selected in act 304 of
A weight map based on the selected curves is also generated (act 506). In one or more embodiments the weight map is generated by dilating the selected curves, resulting in a map in which pixels of one color (e.g., white) represent pixels that are part of a curve with high curvature, and pixels of another color (e.g., black) represent pixels that are not part of a curve with high curvature. The weight map assigns different weights to different pixels, with pixels in regions that include curves with high curvature being assigned larger weights than pixels in regions that do not include curves with high curvature. The weight map can be generated using any of a variety of publicly available and/or proprietary techniques.
The weight map is generated by identifying locations in the input image that include pixels that are part of a curve with high curvature. The curves identified in the weight map are expanded or dilated by a particular radius (e.g., 2). Thus, for example, the weight map identifies, as locations that include pixels that are part of a curve with high curvature, each location identified in the weight map as being part of a curve with high curvature as well as each location within the particular radius (e.g., 2 pixels) of a location identified in the weight map as being part of a curve with high curvature.
Returning to
In generating the blur kernel based on the curves selected in act 306, second-order derivatives of the selected curves are calculated. The second-order derivatives of the curves provide an indication of the direction or trajectory of the blur, with the second-order derivatives of curves that are sharp being approximately dots or single points and the second-order derivatives of curves that are blurred identifying the direction or trajectory of the blur. The blur kernel is generated by reducing (e.g., minimizing) an energy function based on the second-order derivatives to generate the blur kernel.
The second-order derivative 806 identifies the trajectory of the blur with points having lighter or brighter portions to indicate directions of greater movement than darker portions. The second-order derivative 806 is the second-order derivative of the curves with high curvature selected in act 306 of
The blur kernel is generated by reducing (e.g., minimizing) an energy function that identifies a similarity between the blurred input image (e.g., blurred image 220 of
In one or more embodiments, the blur kernel is generated by reducing (e.g., minimizing) the following energy function:
where W refers to the weight map, K refers to the blur kernel, λ* refers to a weight for each first-order partial derivative and λ* ε(λ1, λ2), λt refers to a weight for each second-order derivative and λtε(λ3, λ4, λ5), P refers to the selected pixels in a predicted sharp version of the blurred image (pixels selected using edge directions and/or pixels that are part of a selected curve), B refers to the selected pixels in the blurred input image (pixels selected using edge directions and/or pixels that are part of a selected curve), (P*, B*) refers to the first-order derivative of the predicted sharp and blurred versions of the image, (Pt, Bt) refers to the second-order derivative of the predicted sharp and blurred versions of the image, and β refers to a positive scalar for a regularization term. In one or more embodiments, λ* is set to 1 (e.g., λ1 is set to 1 and λ2 is set to 1), λt is set to 4 times λ* (e.g., λ3 is set to 4, λ4 is set to 4, and λ5 is set to 4), and β is set to 5, although other values can alternatively be used. The predicted sharp version of the image P can be determined using any of a variety of publicly available and/or proprietary techniques to predict or estimate the sharp version of the image.
The energy function (1) includes a regularization term that assists in keeping the blur kernel smooth. In one or more embodiments, this regularization term is the Tikhonov regularization term ⊕∥K∥2, although other regularization terms can alternatively be used.
The first-order derivative (P*, B*) and second-order derivative (Pt, Bt) can be defined as:
(P*,B*)ε{(Px,∂xB),(Py,∂yB)} (2)
(Pt,Bt)ε{(∂xPx,∂xxB),(∂xPy,∂xyB),(∂yPy,∂yyB)} (3)
These first and second order derivatives are treated differently in generating the blur kernel, as indicated above in the energy function (1). As can be seen from the energy function (1), when using the energy function (1) the blur kernel is estimated using derivatives of the pixel values instead of the pixel values themselves.
The first term of the energy function (1) is an energy term based on the first-order derivatives of the pixels selected based on edge directions. The second term of the energy function (1) is an energy term based on the second-order derivatives of the selected curves. The energy function (1) generates the blur kernel based on both the pixels selected based on edge directions and the selected curves. In situations in which the blur kernel is generated based on the pixels selected based on edge directions but not the selected curves, the second term need not be included in the energy function (1). Similarly, in situations in which the blur kernel is generated based on the selected curves but not the pixels selected based on edge directions, the first term need not be included in the energy function (1).
The energy function (1) can be solved in various different manners. In one or more embodiments, the energy function (1) is solved based on the energy function (1) being rewritten in a matrix form, resulting in the following matrix form energy function:
∥A*k−b*∥2+∥W(Atk−bt)∥2β∥k∥2=(A*k−b*)T(A*k−b*)+(Atk−bt)TWTW(Atk−bt)+βkTk (4)
where A* refers to a matrix consisting of P*, At refers to a matrix consisting of Pt, k refers to a vector form of the blur kernel K, b* refers to a vector consisting of B*, and bt refers to a vector consisting of Bt.
A conjugate gradient method is used to approximately optimize the matrix form energy function. The gradient of fk is defined as:
The blur kernel is generated in act 308 by iteratively computing the gradient fk in reducing (e.g., minimizing) the energy function (1).
The second-order derivative (Pt, Bt) defined in statement (3) above relies on the curves with high curvature being formed by a horizontal edge and a vertical edge. Alternatively, a rotation angle of the curves can be incorporated into the second-order derivative. The rotation angle of a curve can be determined (e.g., in act 306) using any of a variety of publicly available and/or proprietary techniques. The rotation angle of a curve can be identified in various manners, such as being the angle of an edge of the curve relative to a reference angle, being an angle within the arc of the curve, and so forth. For example, in an x,y coordinate system in which the x axis is horizontal and the y axis is vertical, the reference angle 0 degrees can be along the x axis. The second-order derivative can be expanded to account for the rotation angle of the curves as follows:
(Pt,Bt)ε{(∂xPx,∂xxB),(∂xPy,∂xyB),(∂yPy,∂yyB),(a∂xxB+b∂yyB)} (6)
where a and b can be automatically determined for a curve based on the orientation of the curve, and can be any value between 0 and 1. The values a and b identify the rotation angle of the curve (e.g., between 0 degrees and 180 degrees), and can be determined in various manners (e.g., by extracting a dominant gradient direction for the curve and using that dominant gradient direction as the value of a and b). The second-order derivatives are expanded to include a linear combination of the second-order derivative to describe the rotation angle.
Returning to
The de-blurred version of the blurred input image is generated using the following model:
B=LK+N (7)
where B refers to an input blurred image (e.g., blurred image 220 of
The blur kernel K is generated based on edges of blurred image B (edges selected based on their directions) and/or curves of blurred image B with high curvature, as discussed above. An estimated latent sharp image L can be determined using any of a variety of publicly available and/or proprietary techniques that predict or estimate the sharp version of the image. For example, an iterative process that alternately approximately optimizes the estimated latent sharp image L and the blur kernel K can be used to determine both the latent sharp image L and the blur kernel K, with the blur kernel K determined in the final iteration being used to generate de-blurred image 222 from the blurred image 220 of
In one or more embodiments, the iterative process for generating the estimated latent sharp image L and the blur kernel K is as follows. To progressively refine the blur kernel K and the latent sharp image L, three steps are iterated: prediction, kernel estimation, and de-convolution. Prediction is performed first in each iteration, providing an initial value of L for blur kernel estimation. The input of the prediction (the image from which the gradient maps are computed) is the blurred image B in the first iteration, and in other iterations is the estimate of L obtained in the de-convolution step of the previous iteration. In the prediction step, gradient maps of L are computed along the x and y directions, which predict salient edges in L with noise suppression in smooth regions, resulting in image L in which the salient edges remain and the other regions have zero gradients. Bilateral filtering is applied to the current estimate of L to suppress possible noise and small details, and a shock filter is then used to restore strong edges in L, The result of the shock filtering, referred to as L′, includes high-contrast edges and enhanced noise, and the noise is removed by computing and thresholding the gradient maps {∂xL′, ∂yL′} of L′.
The threshold for truncating gradients can be determined as follows. To estimate an m×m blur kernel, information of blurred edges in at least m different directions is obtained. Histograms of gradient magnitudes and directions for each ∂L′ are constructed. Angles are quantized by 45 degrees, and gradients of opposite directions are counted together. A threshold is found that keeps at least rm pixels from the largest magnitude for each quantized angle. The value of r can be 2, or alternatively other values. To include more gradient values as the iteration progresses, the threshold determined at the beginning of the iteration process is gradually decreased (e.g., by multiplying by 0.9 in each iteration after the first iteration).
In the kernel estimation step, the blur kernel K is generated (e.g., in act 308 of
It should be noted that, in situations in which an iterative process is used to generate the de-blurred version of the blurred input image, process 300 can be performed in each iteration. A blur kernel can thus be generated in each iteration, and the blurred input image from which the one or more curves with high curvature are selected in act 306 and/or pixels are selected using edge directions in act 304 can be the blurred image 220 of
Various actions performed by various modules are discussed herein. A particular module discussed herein as performing an action includes that particular module itself performing the action, or alternatively that particular module invoking or otherwise accessing another component or module that performs the action (or performs the action in conjunction with that particular module). Thus, a particular module performing an action includes that particular module itself performing the action and/or another module invoked or otherwise accessed by that particular module performing the action.
The example computing device 1102 as illustrated includes a processing system 1104, one or more computer-readable media 1106, and one or more I/O interfaces 1108 that are communicatively coupled, one to another. Although not shown, computing device 1102 may further include a system bus or other data and command transfer system that couples the various components, one to another. A system bus can include any one or combination of different bus structures, such as a memory bus or memory controller, a peripheral bus, a universal serial bus, and/or a processor or local bus that utilizes any of a variety of bus architectures. A variety of other examples are also contemplated, such as control and data lines.
Processing system 1104 is representative of functionality to perform one or more operations using hardware. Accordingly, processing system 1104 is illustrated as including hardware elements 1110 that may be configured as processors, functional blocks, and so forth. This may include implementation in hardware as an application specific integrated circuit or other logic device formed using one or more semiconductors. Hardware elements 1110 are not limited by the materials from which they are formed or the processing mechanisms employed therein. For example, processors may be comprised of semiconductor(s) and/or transistors (e.g., electronic integrated circuits (ICs)). In such a context, processor-executable instructions may be electronically-executable instructions.
Computer-readable storage media 1106 is illustrated as including memory/storage 1112. Memory/storage 1112 represents memory/storage capacity associated with one or more computer-readable media. Memory/storage component 1112 may include volatile media (such as random access memory (RAM)) and/or nonvolatile media (such as read only memory (ROM), Flash memory, optical disks, magnetic disks, and so forth). Memory/storage component 1112 may include fixed media (e.g., RAM, ROM, a fixed hard drive, and so on) as well as removable media (e.g., Flash memory, a removable hard drive, an optical disc, and so forth). Computer-readable media 1106 may be configured in a variety of other ways as further described below.
Input/output interface(s) 1108 are representative of functionality to allow a user to enter commands and information to computing device 1102, and also allow information to be presented to the user and/or other components or devices using various input/output devices. Examples of input devices include a keyboard, a cursor control device (e.g., a mouse), a microphone, a scanner, touch functionality (e.g., capacitive or other sensors that are configured to detect physical touch), a camera (e.g., which may employ visible or non-visible wavelengths such as infrared frequencies to recognize movement as gestures that do not involve touch), and so forth. Examples of output devices include a display device (e.g., a monitor or projector), speakers, a printer, a network card, tactile-response device, and so forth. Thus, computing device 1102 may be configured in a variety of ways as further described below to support user interaction.
Various techniques may be described herein in the general context of software, hardware elements, or program modules. Generally, such modules include routines, programs, objects, elements, components, data structures, and so forth that perform particular tasks or implement particular abstract data types. The terms “module,” “functionality,” and “component” as used herein generally represent software, firmware, hardware, or a combination thereof. The features of the techniques described herein are platform-independent, meaning that the techniques may be implemented on a variety of computing platforms having a variety of processors.
An implementation of the described modules and techniques may be stored on or transmitted across some form of computer-readable media. The computer-readable media may include a variety of media that may be accessed by computing device 1102. By way of example, and not limitation, computer-readable media may include “computer-readable storage media” and “computer-readable signal media.”
“Computer-readable storage media” may refer to media and/or devices that enable persistent and/or non-transitory storage of information in contrast to mere signal transmission, carrier waves, or signals per se. Thus, computer-readable storage media refers to non-signal bearing media. The computer-readable storage media includes hardware such as volatile and non-volatile, removable and non-removable media and/or storage devices implemented in a method or technology suitable for storage of information such as computer readable instructions, data structures, program modules, logic elements/circuits, or other data. Examples of computer-readable storage media may include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical storage, hard disks, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or other storage device, tangible media, or article of manufacture suitable to store the desired information and which may be accessed by a computer.
“Computer-readable signal media” may refer to a signal-bearing medium that is configured to transmit instructions to the hardware of the computing device 1102, such as via a network. Signal media typically may embody computer readable instructions, data structures, program modules, or other data in a modulated data signal, such as carrier waves, data signals, or other transport mechanism. Signal media also include any information delivery media. The term “modulated data signal” means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media include wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, RF, infrared, and other wireless media.
As previously described, hardware elements 1110 and computer-readable media 1106 are representative of modules, programmable device logic and/or fixed device logic implemented in a hardware form that may be employed in some embodiments to implement at least some aspects of the techniques described herein, such as to perform one or more instructions. Hardware may include components of an integrated circuit or on-chip system, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a complex programmable logic device (CPLD), and other implementations in silicon or other hardware. In this context, hardware may operate as a processing device that performs program tasks defined by instructions and/or logic embodied by the hardware as well as a hardware utilized to store instructions for execution, e.g., the computer-readable storage media described previously.
Combinations of the foregoing may also be employed to implement various techniques described herein. Accordingly, software, hardware, or executable modules may be implemented as one or more instructions and/or logic embodied on some form of computer-readable storage media and/or by one or more hardware elements 1110. Computing device 1102 may be configured to implement particular instructions and/or functions corresponding to the software and/or hardware modules. Accordingly, implementation of a module that is executable by computing device 1102 as software may be achieved at least partially in hardware, e.g., through use of computer-readable storage media and/or hardware elements 1110 of processing system 1104. The instructions and/or functions may be executable/operable by one or more articles of manufacture (for example, one or more computing devices 1102 and/or processing systems 1104) to implement techniques, modules, and examples described herein.
The techniques described herein may be supported by various configurations of computing device 1102 and are not limited to the specific examples of the techniques described herein. This functionality may also be implemented all or in part through use of a distributed system, such as over a “cloud” 1120 via a platform 1122 as described below.
Cloud 1120 includes and/or is representative of a platform 1122 for resources 1124. Platform 1122 abstracts underlying functionality of hardware (e.g., servers) and software resources of cloud 1120. Resources 1124 may include applications and/or data that can be utilized while computer processing is executed on servers that are remote from computing device 1102. Resources 1124 can also include services provided over the Internet and/or through a subscriber network, such as a cellular or Wi-Fi network.
Platform 1122 may abstract resources and functions to connect computing device 1102 with other computing devices. Platform 1122 may also serve to abstract scaling of resources to provide a corresponding level of scale to encountered demand for resources 1124 that are implemented via platform 1122. Accordingly, in an interconnected device embodiment, implementation of functionality described herein may be distributed throughout system 1100. For example, the functionality may be implemented in part on computing device 1102 as well as via platform 1122 that abstracts the functionality of the cloud 1120.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
Claims
1. A method comprising:
- obtaining an input image;
- selecting, using an edge direction of each of multiple pixels identified in the input image, one or more of the multiple pixels; and
- generating, using the selected one or more pixels, a blur kernel based on which a de-blurred version of the input image is generated.
2. A method as recited in claim 1, the method further comprising obtaining both gradient magnitudes and edge directions for each of the multiple pixels.
3. A method as recited in claim 2, the selecting comprising:
- assigning each of the multiple pixels to one of multiple groups based on an angle of the edge direction of the pixel;
- applying an adaptive gradient magnitude threshold to the multiple groups so that different groups can have different gradient magnitude thresholds; and
- selecting, as the one or more of the multiple pixels, pixels from the multiple groups having gradient magnitudes that satisfy the gradient magnitude threshold for the group.
4. A method as recited in claim 3, further comprising determining for each group a gradient magnitude threshold so that the selecting pixels from the multiple groups comprises selecting approximately the same number of pixels from each of the multiple groups.
5. A method as recited in claim 3, wherein at least one pixel selected from one of the multiple groups has a lower gradient magnitude than a pixel not selected from another of the multiple groups.
6. A method as recited in claim 1, further comprising:
- receiving an indication of one or more curves each having an angle within a threshold amount of a right angle in the input image; and
- the generating comprising generating, using the selected one or more pixels and the indicated one or more curves, the blur kernel.
7. A method as recited in claim 6, the generating further comprising generating the blur kernel by reducing an energy function based on second-order derivatives of the one or more curves.
8. A method as recite in claim 7, the energy function being further based on first-order derivatives of the selected one or more pixels.
9. One or more computer-readable storage media having stored thereon multiple instructions that, when executed by one or more processors of a computing device, cause the one or more processors to:
- obtain an input image;
- receive an indication of one or more curves each having an angle within a threshold amount of a right angle in the input image; and
- generate, using the indicated one or more curves, a blur kernel based on which a de-blurred version of the input image is generated.
10. One or more computer-readable storage media as recited in claim 9, wherein to generate the blur kernel is further to generate, based on the indicated one or more curves and one or more pixels of edges in the input image, the blur kernel.
11. One or more computer-readable storage media as recited in claim 10, the multiple instructions further causing the one or more processors to select, using an edge direction of each of multiple pixels in the input image, the one or more pixels.
12. One or more computer-readable storage media as recited in claim 10, the multiple instructions further causing the one or more processors to obtain both gradient magnitudes and edge directions for each of the one or more pixels.
13. One or more computer-readable storage media as recited in claim 12, the multiple instructions further causing the one or more processors to:
- assign each of the multiple pixels to one of multiple groups based on an angle of the edge direction of the pixel;
- apply an adaptive gradient magnitude threshold to the multiple groups so that different groups can have different gradient magnitude thresholds; and
- select, as the one or more pixels, pixels from the multiple groups having gradient magnitudes that satisfy the gradient magnitude threshold for the group.
14. One or more computer-readable storage media as recited in claim 9, wherein to generate the blur kernel is to generate the blur kernel by reducing an energy function based on second-order derivatives of the one or more curves.
15. One or more computer-readable storage media as recited in claim 14, the energy function being further based on first-order derivatives of one or more pixels of edges identified in the input image.
16. One or more computer-readable storage media as recited in claim 14, the energy function being further based on, for each of the one or more curves, a rotation angle of the curve.
17. A system comprising:
- an image access module configured to obtain an input image;
- an edge selection module configured to select, using an edge direction of each of multiple pixels identified in the input image, one or more of the multiple pixels;
- a curve selection module configured to select one or more curves each having an angle within a threshold amount of a right angle in the input image; and
- a blur kernel generation module configured to generate, using the selected one or more pixels and the selected one or more curves, a blur kernel indicating how an image capture device was moved while capturing the input image.
18. A system as recited in claim 17, the edge selection module being further configured to obtain both gradient magnitudes and edge directions for each of the multiple pixels.
19. A system as recited in claim 18, the edge selection module being further configured to:
- assign each of the multiple pixels to one of multiple groups based on an angle of the edge direction of the pixel;
- apply an adaptive gradient magnitude threshold to the multiple groups so that different groups can have different gradient magnitude thresholds; and
- select, as the one or more of the multiple pixels, pixels from the multiple groups having gradient magnitudes that satisfy the gradient magnitude threshold for the group.
20. A system as recited in claim 17, the blur kernel generation module being further configure to generate the blur kernel by reducing an energy function based on second-order derivatives of the one or more curves and on first-order derivatives of the selected one or more pixels.
Type: Application
Filed: Nov 19, 2012
Publication Date: May 22, 2014
Patent Grant number: 9076205
Applicant: ADOBE SYSTEMS INCORPORATED (San Jose, CA)
Inventors: Sunghyun Cho (Seattle, WA), Jue Wang (Seattle, WA), Lin Zhong (Somerset, NJ)
Application Number: 13/680,952
International Classification: G06T 5/00 (20060101);