رفتن به نوشته‌ها

مقایسه دستور fspecial disk و fspecial motion

با استفاده از یک برنامه کوچک به صورت عملی تفاوت دستورات  fspecial disk و  fspecial motion را نشان خواهیم داد.

هدف از مقایسه این دو فیلتر این است که بفهمیم کدام یک برای تار کردن تصویر مناسب تر است.

 

'disk' : Circular averaging filter (pillbox) 

h = fspecial('disk', radius) returns a circular averaging filter (pillbox) within the square matrix of side 2*radius+1. The default radius is 5.

 

'motion' :Approximates the linear motion of a camera

 

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(:)) 

تار کردن تصویر

برای دریافت کدهای متلب اینجا کلیک کنید.

منتشر شده در پردازش تصویر و بینایی ماشینپروژه هامتلب

اولین باشید که نظر می دهید

دیدگاهتان را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *