Compute the average image value

This is my assignment:

http://www.cse.yorku.ca/course/2011/...201/Q2/Q2.html

I have no idea what is an image value. I tired looking it up but there's no help.

All the codes are given. I just need to complete the two methods. (a constructor and the computation part).

So, how do you compute it?

Can someone guide me through this?

Thank you for your time.

Re: Compute the average image value

Quote:

In image processing, a frequent operation is to compute the average image value (intensity) or some other statistic over a rectangular sub-region of the image. The region of interest can be specified by 4 integer parameters: top, bottom, left and right. Not knowing the sub-region in advance, a naïve method would require O(n) time to compute this average, where n is the number of pixels in the image. One could speed this up by precomputing the average for all possible sub-regions: how much memory would this require?

Read this carefully and you will hopefully get the answer on your own.

Re: Compute the average image value

So, a "sub-region of the image" is a rectangle. So, how do I compute the average of a rectangle?

Re: Compute the average image value

Quote:

Originally Posted by

**IAmHere**
So, a "sub-region of the image" is a rectangle. So, how do I compute the average of a rectangle?

Not sure. It might be a square or any other shape.

And to compute the average of a rectangle, you must google, there must b many tutorials for finding average or whatever you want. We were not taught what you were taught before assigning this assignment to you. So, it must be you to tell us how you want to compute the average?