Re: convolution
- To: mathgroup at smc.vnet.net
- Subject: [mg38403] Re: convolution
- From: "Mariusz Jankowski" <mjkcc at usm.maine.edu>
- Date: Fri, 13 Dec 2002 04:18:58 -0500 (EST)
- References: <at9e8r$q77$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
"YourEmailId" <YourEmail at lmco.com> wrote in message news:at9e8r$q77$1 at smc.vnet.net... > I'm trying to do a 2 dimensional convolution of the Airy disk with the > image of an extended source in an optical system, using the Digital > Image Processing package. Does anyone have an example routine for doing > this? > > lanny.sterritt at lmco.com > Hi, here is a suggestion. Assuming img is the image and ker is the Airy disk shaped kernel calculate: result = DiscreteConvolve[img, ker, Centered->True]; Display result using: ListDensityPlot[ result, Mesh->False] ; I understand that the Airy disk is defined BesselJ[1,x]^2/x^2, so a 2D disk in rectangular coordinates can be obtained as follows (you may need to change the limits and step size in Table to fit your needs): ker = N[Table[If[x^2 + y^2 == 0, 1/2, BesselJ[1, Sqrt[x^2 + y^2]]^2/(x^2 + y^2)], {x, -6, 6}, {y, -6, 6}]]; Hope this helps, Mariusz =============================== Mariusz Jankowski University of Southern Maine mjkcc at usm.maine.edu 207-780-5580