WL wrote:

Is Motion Blur a convoluted result of an image and a mask? If so, what

mask should I should for a 45 degrees and 10 pixels long motion blur?

`Uniform motion blur (like keep the shutter open too long while
traveling at constant velocity) is equivilant to convolving the image with
a rectangle function.``
`

`g(x,y) = f(x,y)**h(x,y)``
`

`where``
`

`f(x,y) desired (true) image`
`h(x,y) blurring function (the rect function)`
`g(x,y) blurred image`
`** convolution operator``
`

`Taking fourier transform of both sides, and noting that the fourier
transform of a rectangle function is a sinc function, and that convolution
in spatial domain is equivilant to point-by-point multiplication in frequency
domain, we get``
`

`G(wx, wy) = F(wx, wy) * H(wx, wy)``
`

`where``
`

`F(wx, wy) Fourier transform of desired (true)
image`
`H(wx, wy) Fourier transform of blurring function
(sinc)`
`G(wx, wy) Fourier transform of blurred image`
` .*
point-by-point multiplication (in frequency domain)`
` ``
`

`The quick & dirty solution is to divide G by H, then inverse
fourier transform. The following sort of what you would do in matlab.
(note "./" is point-by-point division in matlab)``
`

`G = fft2(g);`
`H = fft2(h);`
`F = G ./ H;``
`

`f = ifft2(F);``
`

`Note -`
` ``
`

`Note:``
`

`0) I assumed it would be probably easier to make up a simple rect
function that's 10pixels wide along the line-of-motion that caused the
blur and take the numerical 2D FFT of that to get H(wx,wy), then to get
the scaling parameters correct and evaluate sinc(k*wx)*sinc(k*wy) directly.
Both methods of getting H(wx,wy) will works.``
`

`1) This is a rough outline of the procedure. You need to double-check
this to make sure the indicies of your variables line up, and that the
location of rect-function in h(x,y) is aligned appropriately, else the
phase of H(wx,wy) will be all dorked up....``
`

`2) we're ignoring the fact that the transfer function H(wx,wy) has
periodic nulls in the frequency response. Dividing 1 / 0 is usually
not advised.``
`

`3) we're also ignoring additive noise (say, electronic noise in
the CCD array), so it will be amplified due to above.``
`

`4) the result will probably look like crap due to (2) and (3).
Try looking into regularized solutions (say, adding a small constant epsilon
= 0.001 or something like that to each element of the inverse of H(wx,wy),
so instead of dividing by 0 you divide by epsilon). Or if you are
ambitious, try to estimate the power of the additive noise, and pose the
problem as a Weiner filter.`
`
--------------BF45DD4A7A44383B33C6D2C9--
`