Ran Yakir (rany++at++amcor.bvr.co.il)
Wed, 10 May 1995 12:57:14 +0000
A small mistake occured in the source lines I've sent you yesterday.
The kernel values for 3X3 should be 1/3 for all 6 entries.
The kernel values for 5X5 should be 1/5 for all 10 entries.
The kernel values for 7X7 should be 1/7 for all 14 entries.
You can get an even nicer defocus effect by not including the center pixel of
the convolution in the convolution. This is done by zeroing its coefficients in
the kernel. Thus the 3X3 kernel will have the form :
float kernel[3] =
{
1/2, 0.0, 1/2,
1/2, 0.0, 1/2
};
If you want to add a defocus level to the effect, you can create the kernel
on-the-fly, by applying the values 0..1 to the center coefficients, and
1/size..0 to the other coefficients, depending on the blur level.
Regards,
Ran
--
__ | Ran Yakir
/_) _ __ \ / _ / o __ | Graphics App. Chief Engineer
/ )_ (_(_) ) \/ (_(_/<_(_)( | BVR Technologies Ltd.
_/ |
-------------------------------------+--------------------------------
Phone : | E-mail : rany++at++bvr.co.il
Work : 972-3-5715671 |
Res. : 972-9-989974 |
Fax : 972-3-5715668 |
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:29 PDT