Trusted by Students Everywhere
Why Choose Us?
0% AI Guarantee

Human-written only.

24/7 Support

Anytime, anywhere.

Plagiarism Free

100% Original.

Expert Tutors

Masters & PhDs.

100% Confidential

Your privacy matters.

On-Time Delivery

Never miss a deadline.

: 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 Jul 29, 2020

: 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

    }

 

  }

 

}

Expert Solution

For detailed step-by-step solution, place custom order now.
Need this Answer?

This solution is not in the archive yet. Hire an expert to solve it for you.

Get a Quote
Secure Payment