-2

I have 10 gray images of the same size. I would like to obtain the mean gray value and standard deviation per pixel in the image set. How can I do this?

Dev-iL
  • 23,742
  • 7
  • 57
  • 99
  • We won't do your work for you. Attempt the problem, then return and update your question if you run into a _specific_ problem – Takarii Apr 06 '17 at 11:32

1 Answers1

1

Let's say your images are stored in a XxYxN uint16 array called imgs:

X = 300; Y = 400; N = 10;
imgs = randi(2^16,Y,X,N,'uint16');

All you need to do is pass this matrix to mean and std, while specifying that you want to operate along the 3rd dimension:

meanMap = mean(imgs,3,'double');
stdMap = std(double(imgs),0,3);
Dev-iL
  • 23,742
  • 7
  • 57
  • 99
  • And you have 10 of them right? And how are they stored? Let's assume `img1`, `img2` etc. So do `imgs = cat(3,img1,img2,....)`. – Dev-iL Apr 06 '17 at 11:47
  • I can write the code so X = 300; Y = 400; imgs = randi(2^16,Y,X,'uint8'); – Wasim Alqadasi Apr 06 '17 at 11:49
  • and .......meanMap = mean(imgs,2,'double'); stdMap = std(double(imgs),0,2); – Wasim Alqadasi Apr 06 '17 at 11:50
  • The 10 image are already stored on pc .. I lesse from matlab and should I for each image the gray mean and the standard deviation for each pixel and I should create a diagram of average to standard deviation for everything 10 images – Wasim Alqadasi Apr 06 '17 at 12:00
  • Please help me Thank you – Wasim Alqadasi Apr 06 '17 at 12:43
  • I already helped with your original question (which was very broad to begin with). What you're asking now would be a **[different question](https://meta.stackexchange.com/questions/43478/exit-strategies-for-chameleon-questions "at Stack Exchange sites, “chameleon questions” are not quite welcome")**, which you should post separately. – Dev-iL Apr 06 '17 at 12:52