[Bf-committers] Re: Re: Re: Vectorial Motion Blur
frédéric van der essen
fred at mentalwarp.com
Sun Feb 13 18:28:58 CET 2005
You're right :) next time i'll think twice before posting :)
GSR - FR wrote:
>http://www.netmeister.org/news/learn2quote.html
>
>Hi,
>fred at mentalwarp.com (2005-02-13 at 1739.34 +0100):
>
>
>>A=zeros(255,255); %base image
>>%Add Black square
>>BlockSize=10;
>>BlockPosX=10;
>>BlockPosY=10;
>>for i=BlockPosX:(BlockPosX+BlockSize)
>> for j=BlockPosY:(BlockPosY+BlockSize)
>> A(i,j)=1; % set pixels in the square =1
>> end
>>end
>>B=zeros(255,255); % the motion blurred image
>>
>>for i=5:250 % from 5 to 250 because the blur needs a margin.
>> for j=5:250
>> B(i,j)=( A(i,j)+A(i+1,j+1)+A(i+2,j+2)+A(i-1,j-1)+A(i-2,j-2) )
>>/5; % computes the blur on a 5pixels length with a -45° direction
>> end
>>end
>>
>>
>
>Your code uses the same motion vector for all pixels. Now try what I
>said: one pixel with motion, the rest without. Not everything with the
>same motion vector, as your code does.
>
>Say dot 100,100 is the one moving, colour 0 in all channels (black),
>while the rest are 255 (white). Your code will make 100,100 be (255 +
>255 + 0 + 255 + 255) / 5 = 204, dirty white. But the others will be
>255, cos the formula for them, due their "non moving vector" has to be
>B(i,j)=A(i,j).
>
>GSR
>
>
>
More information about the Bf-committers
mailing list