The present disclosure relates to a method and an apparatus for restoring a motion blurred image.
A CCD image sensor or a CMOS image sensor included in a digital camera or a camera phone can read-out electric charge collected by a photoelectric device with constant velocity during an exposure time.
Here, the CCD image sensor or the CMOS image sensor employed in general popular digital camera or camera phone may have small size. Accordingly, in the event that photographing is performed in a room or at night having comparative small amount of lighting, the velocity of the read-out may become slower. In this case, the image sensor increases the exposure time to obtain adequate electric charge, and thus it is sensitive to motion such as hand-shake or moving of an object.
Additionally, since focal length becomes longer or view angle becomes narrower when a zoom function of the camera is used, great motion may be shown on output of an image though small shakiness occurs.
A motion blur may occur to the image by the motion. In the event of reducing arbitrarily the exposure time of the camera to remove the motion blur, the motion blur is reduced but much noise occurs to the image and brightness gets dark.
A conventional method of restoring a motion blurred image estimates a point spread function and restores using the estimated result. A method of minimizing repetitive error and a method of comparing and analyzing images, etc. have been used so as to restore the motion blurred image.
However, the problem exists in that the conventional methods require much repetition and calculation amount or several images taken at different view angles.
To solve problem of the convention technique, the invention is to provide a method and an apparatus for restoring a high-speed motion blurred image for minimizing occurrence of artifact.
In one embodiment, the present invention is to provide a method of restoring a motion blurred image, the method comprising: calculating a motion trajectory and a project trajectory of a camera using an embedded sensor; estimating a point spread function according to camera motion by using the motion trajectory and the project trajectory; and restoring the motion blurred image using the estimated point spread function and a spatially variant activity map.
Data sensed by the embedded sensor is a gyro data for estimating angular velocity according to shaking of the camera, and the project trajectory follows a Gaussian distribution.
The point spread function is defined as accumulation of trajectory reweighted by using the Gaussian distribution.
The spatially variant activity map is used for removing ringing artifact while an edge is maintained in the motion blurred image.
In another embodiment, an apparatus for restoring a motion blurred image comprising: a processor; and a memory connected to the processor. Here, the memory stores program instructions executable by the processor, to calculate a motion trajectory and a project trajectory of a camera using an embedded sensor, estimate a point spread function according to camera motion by using the motion trajectory and the project trajectory, and restore the motion blurred image using the estimated point spread function and a spatially variant activity map.
A method and an apparatus of the invention estimate a point spread function of an image using an embedded sensor and probabilistic distribution, thereby estimating rapidly the point spread function from a single image and minimizing occurrence of artifact through a spatially variant image restoring method.
Example embodiments of the present invention will become more apparent by describing in detail example embodiments of the present invention with reference to the accompanying drawings, in which:
The invention is susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will herein be described in detail. It should be understood, however, that there is no intent to limit the invention to the particular forms disclosed, but on the contrary, the invention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the invention. Like numbers refer to like elements throughout the description of the figures.
Hereinafter, embodiments of the invention will be described in detail with reference to accompanying drawings.
As shown in
Particularly, an image point on an image plane is related to an object point by a homogeneous vector as shown in following equation 1.
[xk, yk, 1]T=∪k[X, Y, Z, 1]T [Equation 1]
Here, ∪k indicates a project matrix of kth camera.
If a motion trajectory is generated through a spatially invariant method, K points on the image plane generate a point spread function PSF of corresponding motion blur as following.
A point spread function h(m,n) for arbitrary coordinate (m, n) is defined as sum of impulse function δ(m−xk, n−yk) shifted by xk and yk.
In the spatially invariant point spread function, an image degradation model of the motion blur is shown with vector-matrix type as following.
g=Hf+η, [Equation 3]
Here, g means a motion blurred image, H indicates a degradation matrix, f means an ideal image in which the motion blur does not occur, and η indicates an additive noise.
In the event that size of the image corresponds to N×N, g, f and η are expressed as N2×1 lexicographically order vector, and H indicates a block circulant matrix of N2×N2 defined by the point spread function.
A method of the present embodiment analyzes a motion trajectory and calculates a project matrix using an embedded sensor.
To estimate the point spread function of motion, points of each of scenes are projected on an image plane according to the project matrix.
Hereinafter, a process of estimating the point spread function using motion tracking of a camera will be described.
Only relative location of the camera is required for estimating size and shape of the point spread function of the motion.
This is because the point spread function equals to total sum of intensities reflected from first location of motion of the camera to final location of the motion of the camera as shown in equation 2.
Location of respective cameras is projected on the image plane and may be expressed by using planar homography as following.
Here, C means an intrinsic matrix of the camera, R indicates a rotation matrix, d means scene depth, t indicates a translation vector, and n, means a normal vector on the image plane.
Relation between motion trajectory and camera translation is shown in
Here, lj and Δtc indicate focal length and the camera translation, respectively.
If the scene depth is adequately higher than focus distance, the motion trajectory may be neglected. Accordingly, the camera translation does not affect to the point spread function of the motion under the condition that the scene depth is great. As a result, equation 4 is simplified as follows.
(xk, yk, 1)T=[CRiC−1](x0, y0, 1)T [Equation 6]
It is assumed that camera coordinate is arrayed on global coordinate located on an optical axis of the camera.
The camera matrix C is determined by the focus distance as shown in below under the above assumption.
A rotation matrix is calculated through following equation 8 by using small-angle approximation and a spatially invariant motion blur.
Here, ωix and ωiy mean ith angular velocity surrounding x axis and y axis.
Since lftan(ω)≈lfω in the event of small ω, the project matrix may be expressed with following equation 9.
In one embodiment, the method uses gyro data so as to estimate angular velocity according to camera motion as shown in
Under ideal condition, the projected trajectory is identical to the point spread function of the camera motion.
However, the gyro data includes noise in real environment. Particularly, the gyro data including the noise brings out mismatching between the location projected on the image plane and real point spread function sample.
To perform robust estimation of the point spread function using the gyro data including the noise, it is assumed that the projected trajectory follows Gaussian distribution in the invention.
As a result, the projected trajectory corresponds to sum of the Gaussian distribution.
As shown in
As shown in
The method of the invention uses a sensor data logger provided in C. Jia and B. Evans, “Probabilistic 3-D motion estimation for rolling shutter video rectification from visual and inertial measurements,” in Proceedings of the IEEE 14th International Workshop on Multimedia Signal Processing (MMSP '12), pp. 203-208, September 2012., so as to obtain gyro data synchronized with a blur frame.
The gyro data and corresponding blurred frame is time-stamped, and opening and closing of a shutter are recorded in order to analyze delay.
Hereinafter, a process of restoring an image through a spatially adaptive (variant) method by using local statistics will be described.
If the point spread function of the motion is estimated, shaking of the motion is solved through a simple process of restoring the image.
Recently, many methods of restoring the image have been provided so as to remove various types of degradation parameter of the image. Since the restoration of the image corresponds to bad condition problem, standardized solution requires occasionally complex calculation.
To remove the motion blur without artifact not desired, the method of restoring the image according to the present embodiment is expressed by using local statistics for minimizing an energy function defined as following equation 11.
Here, ∥·∥ means an Euclidean norm, “◯” indicates an element-wise multiplication operator, Wm means a spatially variant activity map, C indicates a high pass filter, λ1, λ2 mean respectively a horizontal regularization parameter and a vertical regularization parameter, and D1 and D2 indicate a horizontal differential operator and a vertical differential operator, respectively.
If estimated f has artifact such as ringing or noise amplification, Dif has sharp transition, and so ∥Df−DiCg∥ increases.
Solution of minimization problem is obtained by solving an equation that differential in equation 11 makes 0 as shown in below.
Ringing artifact is shown at an edge or nearby of a boundary, and thus the spatially adaptive activity map is used to remove the ringing artifact while the edge is maintained.
Here, σ12 means a local variance near (x,y) in an input image, and pi indicates a parameter adjustable so that the activity map is distributed at [0,1] as far as possible.
In the present embodiment, pt=1500, at which most excellent performance is realized about 5×5 block for the local variance, is empirically used.
A matrix T corresponds to block-circulant for the spatially invariant point spread function of the motion as shown in equation 13, and thus a linear formula in equation 12 may be solved by using a two-dimensional discrete fourier transform.
Here, and {tilde over (f)}, {tilde over (g)}, {tilde over (h)}, {tilde over (d)} {tilde over (ω)}m and {tilde over (c)} indicate an estimated image, a measurement image, the point spread function, a differential filter, the activity map and discrete fourier transforms of the high pass filter, respectively. Accordingly, the restoring problem is as follows.
Here, a restore image {circumflex over (f)} is an inverse discrete fourier transform.
On the other hand, the technical features described above can be implemented in the form of program instructions that may be performed using various computer means and can be recorded in a computer-readable medium.
The apparatus for restoring the motion blurred image of the invention may include a processor and a memory.
The processor may include a central processing unit CPU executable a computer program and a virtual machine, etc.
The memory may include a non-volatile storage device such as a fixed hard driver or a detachable storage device. The detachable storage device may have a compact flash unit, an USB memory stick, etc. The memory may include a volatile memory such as various random access memories.
The memory stores program instructions executable by the processor.
The program instructions recorded on the memory can be designed and configured specifically for the present invention or can be a type of medium known to and used by the skilled person in the field of software. Examples of the program of instructions may include not only machine language codes produced by a compiler but also high-level language codes that can be executed by a computer through the use of an interpreter, etc.
The hardware mentioned above can be made to operate as one or more software modules that perform the actions of the embodiments of the invention, and vice versa.
The embodiments of the invention described above are disclosed only for illustrative purposes. A person having ordinary skill in the art would be able to make various modifications, alterations, and additions without departing from the spirit and scope of the invention, but it is to be appreciated that such modifications, alterations, and additions are encompassed by the scope of claims set forth below.
Number | Date | Country | Kind |
---|---|---|---|
10-2015-0085274 | Jun 2015 | KR | national |
This application claims the priority of Korean Patent Application No. 10-2015-0085274, filed on Jun. 16, 2015 in the KIPO (Korean Intellectual Property Office). Further, this application is the National Phase Application of International Application No. PCT/KR2016/002513 filed Mar. 14, 2016, which designates the United States and was published in Korean. Both of the priority documents are hereby incorporated by reference in their entireties.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/KR2016/002513 | 3/14/2016 | WO | 00 |