What is the kernel of linear motion blur in fspecial function??

7 views (last 30 days)
I used fspecial function and imfilter in order to apply the linear motion blur. But, I don't know about kernel of motion blur option.
In help of mathlab, the kernels of the gaussian, smooth and etc. are described, expect on the motion blur.
What is the kernel of linear motion blur in fspecial function? How could I get some infomation about this kernel? (paper,books, and etc.)
Thanks.

Answers (1)

David Young
David Young on 15 Sep 2011
In release 2011a the documentation is precise. Maybe you have an old release that was not so well documented? In case that's the problem, this is from doc fspecial in 2011a:
"h = fspecial('motion', len, theta) returns a filter to approximate, once convolved with an image, the linear motion of a camera by len pixels, with an angle of theta degrees in a counterclockwise direction. The filter becomes a vector for horizontal and vertical motions. The default len is 9 and the default theta is 0, which corresponds to a horizontal motion of nine pixels.
"To compute the filter coefficients, h, for 'motion':
  1. Construct an ideal line segment with the desired length and angle, centered at the center coefficient of h.
  2. For each coefficient location (i,j), compute the nearest distance between that location and the ideal line segment.
  3. h = max(1 - nearest_distance, 0);
  4. Normalize h:h = h/(sum(h(:))"
To get a handle on that, just look at what the kernel is for specific parameters. For example execute
fspecial('motion', 10, 45)
I'm not aware of papers or books that deal with this particular kernel, though maybe books on computer graphics will have something to say on motion blur in general. The idea's pretty simple though: motion blur is modelled by convolution with a straight line segment oriented along the direction of motion and with a length equal to the image speed times the exposure duration. The fspecial kernel approximates this on a discrete grid, with a particular (possibly somewhat arbitrary) choice about how to weight individual pixels close to the line.

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!