Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / : Apply the Averaging Filter to an image   For this task you will be implementing the averaging filter algorithm         used in Digital Image Processing

: Apply the Averaging Filter to an image   For this task you will be implementing the averaging filter algorithm         used in Digital Image Processing

Computer Science

: Apply the Averaging Filter to an image   For this task you will be implementing the averaging filter algorithm

 

 

 

  used in Digital Image Processing. You will be given a pointer to the

  source image (2D array of type unsigned char) along with the number

  of rows an columns in that image. You will be also given a pointer to

  the destination image. Your algorithm will scan the source image element

  by element (or pixel by pixel) and compute the average of all the neighbors

  of that pixel. This average value will be assigned to the corresponding

  pixel in the destination image.

 

 

*/

 

int filter_average(unsigned char * src, unsigned char * dst, int rows, int cols, int filter_size)

{

  for(int i=filter_size/2; i<rows-(filter_size/2); i++)

  {

    for(int j=filter_size/2; j<cols-(filter_size/2); j++)

    {

      int res = 0;/// Don't modify this line

 

 

      /********* Insert your code below *******/

 

        /// Read all the neighbors of the current pixel at (i,j)

 

 

        /// Compute their mean

        /// Assign the value of mean to the variable 'res'

 

 

 

      /****************************************/

      *(dst + (i*cols)+j) = (unsigned char) res; /// Don't modify this line

    }

 

  }

 

}

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE