# Image Kernels and Convolution (Linear Filtering)

Initializing live version Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

This Demonstration shows how the convolution operation can be used in conjunction with a 3×3 kernel to modify an image linearly.

[more]

The controls at the top are used to define the coefficients of the kernel to apply to the image through a convolution operation. The "examples" controls show some common configurations of kernels; the "random" button gives a pseudorandom filter. You can vary the values of the "kernel matrix" to test new configurations.

[less]

Contributed by: Hector Sanchez (September 2011)
Open content licensed under CC BY-NC-SA

## Snapshots ## Details

The discrete convolution operation is defined as: ,

where is the original image, is the transformed (or filtered image), is the kernel to be applied to the image, and are the coordinates of the pixels.

Suppose an image has the grayscale pixel values and we want to transform by a kernel .

The value of the pixel at on the converted image is .

This operation of "masking" the image's pixels with the kernel values is repeated for every value of the image to obtain the transformed image .

In image processing applications, masking implements linear filters; the kernels are the "recipes" from which the transformed images get their properties.

References

 W. Burger and M. J. Burge, Principles of Image Processing: Fundamental Techniques, New York: Springer 2009.

 W. Burger and M. J. Burge, Principles of Image Processing: Core Algorithms, New York: Springer, 2011.

 R. Szeliski, Computer Vision: Algorithms and Applications, New York: Springer, 2010.

## Permanent Citation

Hector Sanchez

 Feedback (field required) Email (field required) Name Occupation Organization Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback. Send
{"ft_lang_label":"__label__en","ft_lang_prob":0.81628865,"math_prob":0.625545,"size":1735,"snap":"2020-24-2020-29","text_gpt3_token_len":379,"char_repetition_ratio":0.12593876,"word_repetition_ratio":0.044444446,"special_character_ratio":0.21210374,"punctuation_ratio":0.13836478,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96633476,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],"im_url_duplicate_count":[null,null,null,null,null,3,null,3,null,3,null,3,null,3,null,3,null,3,null,3,null,6,null,3,null,6,null,3,null,3,null,6,null,3,null,6,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-06-02T06:10:16Z\",\"WARC-Record-ID\":\"<urn:uuid:4ffe240d-6e35-4979-a19f-622da927368c>\",\"Content-Length\":\"29989\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:26f05c86-ae4b-47ca-9252-009508498e92>\",\"WARC-Concurrent-To\":\"<urn:uuid:d54b9620-568d-40a9-8a49-e82406161400>\",\"WARC-IP-Address\":\"140.177.205.90\",\"WARC-Target-URI\":\"https://demonstrations.wolfram.com/ImageKernelsAndConvolutionLinearFiltering/\",\"WARC-Payload-Digest\":\"sha1:DZOQQQFNELFOEU7BYEBQ5EIIHT2K2E3I\",\"WARC-Block-Digest\":\"sha1:HNZSKEYCIIWBPVGOZV76NV4TNR33TZWL\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-24/CC-MAIN-2020-24_segments_1590347422803.50_warc_CC-MAIN-20200602033630-20200602063630-00384.warc.gz\"}"}