# How to get average of the image?

3 visualizzazioni (ultimi 30 giorni)
kiruthika r il 18 Set 2015
Modificato: Thorsten il 18 Set 2015
I have an image as shown in the figure. I want to find the average of this image and want to plot the same in the graph.
##### 2 CommentiMostra NessunoNascondi Nessuno
Walter Roberson il 18 Set 2015
Are you definitely starting with an image? And not with a .fig, and not with the data that was plotted?
kiruthika r il 18 Set 2015
I got the above graph using improfile command

Accedi per commentare.

### Risposte (2)

Walter Roberson il 18 Set 2015
Use the
[cx,cy,c] = improfile(I,xi,yi,n) additionally returns the spatial coordinates of the pixels, cx and cy, of length n.
form of impixel. The cx and cy will give coordinates of the pixels. The c will return intensities of the pixels.
But before you can average them you need to be clearer about what you want to average. Should all of the values everywhere on the lines be averaged together? Should all of the values for each x be averaged together? Should the values that are the same distance along the profile be averaged together? In the places where some of the lines do not exist (such as where the distance along the profile is shown as 2, where only 2 of the 5 lines seem to have presence, should the average be "divide by the number that are there" or should it be "divide by 5" ?
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

Thorsten il 18 Set 2015
Modificato: Thorsten il 18 Set 2015
If you have a grayscale image I you can compute the man across all rows (i.e., horizontal cross-sections of the image) using
mI = mean(I);
If you want to achieve something else, it would be helpful to attach the image and the code you use to plot the figure.
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Image Arithmetic in Help Center e File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by