Page 348 - AI Ver 3.0 class 10_Flipbook
P. 348

Convolution


              Till now, we have learned an image is a visual representation,
              typically made up of tiny elements called pixels. When many
              pixels are arranged together in a grid, they form a complete
              image that we can see and recognise. Each pixel has a value
              ranging from 0 to 255 to specify  color and brightness.        Normal           1977            Aden

              The computer stores and image in number. But what happens
              if we modify these numbers? The answer is simple: the image
              changes. Altering pixel values directly impacts how the image
              looks, and this concept forms the foundation of image editing.
              Today,  we  commonly  use  various  image  editing  tools  like
                                                                             Brannan        Brooklyn        Calrendon
              Photoshop, along with apps such as Instagram and Snapchat,
              to enhance images by applying filters. These filters work by
              uniformly modifying the pixel values across the entire image,
              resulting in visual transformations.
              But  how  do  these  filters  achieve  such  effects?  This  is
              accomplished  using  a  mathematical  process  called          Earlybird      Gingham          Hudson
              convolution, which involves a convolution operator to manipulate pixel values and create the desired changes.
              Convolution is not only essential for applying filters but also plays a significant role in image processing tasks
              like  sharpening,  blurring,  and  edge  detection.  By  altering  pixel  values  systematically  through  convolution,  we
              can enhance image quality, add creative effects, or even extract critical features for advanced applications like
              Computer Vision.
              In simple terms, convolution is passing a "kernel" matrix over the whole "image" matrix to give the convoluted
              matrix i.e., the filtered image.
              Technically, convolution is defined as a simple Mathematical operation that multiplies two numeric arrays of the
              same dimensions but different sizes to produce a third numeric array of the same dimensions. For example:
                             1  1   1   0   0  0   1
                             1  0   1   0   1  0   0                                4  5   3   2   2
                                         x1  x1  x0
                             1  1   0   1   1  0   1                                2  4   3   4   2
                                         x0  x1  x1
                                                                1  1   0
                             0  1   0   1   0  1   0                                4  4   3   5   3
                                         x1  x0  x1
                             0  1   1   1   0  1   1     *      0  1   1     =      4  5   3   4   4
                                                                1  0   1
                             1  1   0   1   1  1   0                                4  3   6   4   3
                             1  0   1   0   1  1   0
                                   Image Matrix                Kernel Matrix  Convoluted Matrix/Desired image
                                        A                          B                       C
              The resulting pixel is calculated as:
              (0×1) + (1×1) + (0×0) + (1×0) + (1×1) + (0×1) + (1×1) + (0×0) + (1×1) = 4
              Kernel


              Kernel is also known as a Convolution Matrix or mask (typically a 3x3 or 5x5 matrix) will help you in image
              processing by creating a wide range of effects like sharp, blur, masking etc. The kernel is slid across the image
              and multiplied with the input image matrix to generate an output image with an enhanced desired effect.

                    346     Touchpad Artificial Intelligence (Ver. 3.0)-X
   343   344   345   346   347   348   349   350   351   352   353