Re: Blurring with mathematica

• To: mathgroup at smc.vnet.net
• Subject: [mg54724] Re: Blurring with mathematica
• From: "Steve Luttrell" <steve_usenet at _removemefirst_luttrell.org.uk>
• Date: Mon, 28 Feb 2005 03:27:11 -0500 (EST)
• References: <cvrqhi\$p5c\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Generate an image.

image = Table[Random[], {128}, {128}];
Show[Graphics[Raster[image]], AspectRatio -> 1];

Generate a Gaussian blurring kernel.

halfwindow = 5;
sdev = 2;
kernel = Table[Exp[-((i^2 + j^2)/(2*sdev^2))],
{i, -halfwindow, halfwindow}, {j, -halfwindow, halfwindow}];
Show[Graphics[Raster[kernel]], AspectRatio -> 1];

Blur the image.

image2 = ListCorrelate[kernel, image];
image2 /= Max[image2];
Show[Graphics[Raster[image2]], AspectRatio -> 1];

If you want to blur with circular wraparound then use

ListCorrelate[kernel, image,
{{halfwindow + 1, halfwindow + 1},
{halfwindow + 1, halfwindow + 1}}];
Steve Luttrell

<V.Marinakis at damtp.cam.ac.uk> wrote in message
news:cvrqhi\$p5c\$1 at smc.vnet.net...
> Hello everyone.
>
> I have an image which is stored as an 128 times 128
> matrix and I want to add gaussian blurring. Does anyone
> know how can this be done with mathematica?
>
> Best, Vangelis Marinakis.
>

```

• Prev by Date: Re: Exporting output cells to .eps
• Next by Date: Re: Mathematica batch file
• Previous by thread: Re: Blurring with mathematica
• Next by thread: Mathematica batch file
{"ft_lang_label":"__label__en","ft_lang_prob":0.66222185,"math_prob":0.69941705,"size":1241,"snap":"2020-24-2020-29","text_gpt3_token_len":403,"char_repetition_ratio":0.12530315,"word_repetition_ratio":0.0,"special_character_ratio":0.32312652,"punctuation_ratio":0.25403225,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97574437,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],"im_url_duplicate_count":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-07-11T02:15:57Z\",\"WARC-Record-ID\":\"<urn:uuid:97d9f325-31bc-4fe3-9cc6-54781ea1e86f>\",\"Content-Length\":\"44640\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:fc2db7bd-8aba-4e75-8f01-57ec1c614bfe>\",\"WARC-Concurrent-To\":\"<urn:uuid:2720a7f9-8a8d-45a8-abf9-28ae59dc91cc>\",\"WARC-IP-Address\":\"140.177.205.73\",\"WARC-Target-URI\":\"http://forums.wolfram.com/mathgroup/archive/2005/Feb/msg00874.html\",\"WARC-Payload-Digest\":\"sha1:JGYSRPA3XWCUSJG2BTQS3LDKNWGEO267\",\"WARC-Block-Digest\":\"sha1:VNA4YKGYQ2QTITKNHT7TNB4DR5J22GHZ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-29/CC-MAIN-2020-29_segments_1593655919952.68_warc_CC-MAIN-20200711001811-20200711031811-00461.warc.gz\"}"}