Mike
Posts:
336
Registered:
4/17/07


Re: quick way to calculate standard deviation of multiple images
Posted:
Oct 10, 2012 8:33 PM


I want to generate standard deviation image from multiple images. Thanks Mike On Wednesday, October 10, 2012 11:05:22 AM UTC+8, Nasser M. Abbasi wrote: > On 10/9/2012 9:54 PM, Mike wrote: > > > Hi > > > > > > I have n images and want to calculate standard deviation of these images for every pixel. > > > My code is > > > > > > X=zeros(nrow,ncol,nimg); > > > for irow=1:nrow > > > for icol=1:ncol > > > tmp=X(irow,icol,:); > > > Xstd(irow,icol)=std2(tmp); > > > end > > > end > > > > > > It takes a lot of time to run it. > > > Is there a quick way to do this? > > > Thanks > > > Mike > > > > > > > > > try to preallocate space for 'Xstd' matrix above. > > Also, no need for the tmp there. Just type something like > > > > X=zeros(nrow,ncol,nimg); > > Xstd=zeros(nrow,ncol); > > > > for irow=1:nrow > > for icol=1:ncol > > Xstd(irow,icol)=std2(X(irow,icol,:)); > > end > > end > > > > (I do not understand what you actually doing there, what > > do you mean by finding std for a pixel? > > > > Nasser

