Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8617359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:50:17+00:00 2026-06-12T05:50:17+00:00

I have to write a program that will take in an image as input,

  • 0

I have to write a program that ” will take in an image as input, represented by 2d array pixel values(for simplicity, each pixel can be represented by an integer). Output the resulting smoothed image by applying the mean filter to every pixel in the array”.

I’m just learning about arrays, but I am lost as to how to even start this program. Whenever I search this topic it gets very confusing because every example or concept that I find is using or talking about actual images. Since my program is using integers, I’m having a hard time distinguishing what is needed and what is not. Basically I understand the premise(at least i think I do), each number must take the mean value from the 4 numbers around it, but outside the basic concept, I’m at a loss as to what needs to be done. Any help, suggestions, or examples would be great.

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:50:18+00:00Added an answer on June 12, 2026 at 5:50 am

    A key concept:

    int values[20][20];
    float intermediates[20][20];
    for (int y = 1; y < 19; y++)
      for (int x = 1; x < 19; x++)
        intermediates = (float)values[y][x];
    
    int means[20][20];
    for (int y = 1; y < 19; y++)
      for (int x = 1; x < 19; x++)
        means[y][x] = (int) ( (float) (intermediates[y-1][x-1] + intermediates[y-1][x] + intermediates[y-1][x+1] + intermediates[y][x-1] + intermediates[y][x] + intermediates[y][x+1] + intermediates[y+1][x-1] + intermediates[y+1][x] + intermediates[y+1][x+1]) / 9.0F); //  Divisor is 9 because we added nine values and we're getting the mean
    

    Now there are 4 corner cases: intermediates[0][0], intermediates[0][19], etc. and then all the sides.

    The values were copied into “intermediates” first because I didn’t want to put (float)in front of everything.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

for an assignment I have to write a program that will take in an
I am trying to write a program that will take the users input value
I have several scripts that take as input a directory name, and my program
I need to write a program that will take a existing local windows user,
I'm trying to write a program that will take an HTML file and make
I have a class assignment where I have to write a program that will
I want to write a program that will take substrings from a given string.
I am trying to write a program that will take a text file with
Im trying to write a simple program that will take 2 multi line inputs
I have to write a program using the IAS instruction set that will loop

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.