how to find mean of an image

11 views (last 30 days)
Aditi
Aditi on 23 May 2011
Commented: Walter Roberson on 27 May 2018
how to find mean of an image
  3 Comments
Aditi
Aditi on 23 May 2011
the class of my picture is double...and please tell me how do find variance of an image..
Walter Roberson
Walter Roberson on 23 May 2011
mean() and variance() convert the values as if they were double precision, so you do not usually need to be concerned about what the original data type was.

Sign in to comment.

Accepted Answer

Wolfgang Schwanghart
Wolfgang Schwanghart on 23 May 2011
m = mean(I(:));
  2 Comments
Anil Sarode
Anil Sarode on 27 May 2018
how does the mean is calculated, I mean by adding all the pixel values and then divide by a total number of pixels?
Walter Roberson
Walter Roberson on 27 May 2018
mean() is usually calculated by taking converting the numbers to double, taking the sum and dividing by the number of elements.
However, there are is an option for mean(), 'native', that tells it not to convert the numbers to double, to use the passed-in data type for the mean calculation. That calculation uses more complicated logic.

Sign in to comment.

More Answers (1)

murk hassan memon
murk hassan memon on 27 Mar 2018
Currently i am working on blood images in order to detect the malaria.. i have to identify out the behaviour of normal and abnormal blood images for this first i have to find out the mean value of those blood images in a sense if suddenly variation occur in mean value of any image then it is said to be abnormal image right? now i am getting a confusion that whether i have to find the mean value of image or first i have to make matrix order of an image. waiting for response
  4 Comments
Walter Roberson
Walter Roberson on 28 Mar 2018

It depends what your image is of.

Suppose you have an image of a single cell, but it happens to be high resolution. Then, after you have removed the parts of the image that are outside of the boundaries of the single cell, you would perhaps be wanting to take the mean of the entire image.

But suppose instead you have an image of multiple cells, where only some of the cells were abnormal. You could still mask out areas that are outside any cell. If you take the mean of the part only inside the cells, then you could be taking the mean of a bunch of good cells with a small number of abnormal cells -- the more good cells you had the less the influence of the abnormal cells would be, so you could end up missing the abnormal cells. In such a case you would want to consider the mean of each cell separately.

Now, for any one cell, is it the case that the color is affected for the entire cell? Or is it the case that part of the cell is affected in color? If only part is affected in color, then the mean color over the entire cell is going to be affected by the proportion of affected area to non-affected area. And perhaps that is reasonable for your situation. But if you need to identify the part of the cell that is affected then you need to look at only portions of the cell at a time.

If you are attempting to look at portions of a cell at a time, then there is the question of how large an area you should examine. That can depend on what you are looking for. Ask yourself: if the image were at (say) 5x further magnification, then would you want the area you take of the mean of to grow with the magnification, or would you instead want the higher resolution to identify the abnormal section more precisely ?

murk hassan memon
murk hassan memon on 5 Apr 2018
ok i got it. and will also try along with your suggestions. thank u soo much

Sign in to comment.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!