Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: quick way to calculate standard deviation of multiple images
Replies: 5   Last Post: Oct 10, 2012 8:35 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Mike

Posts: 336
Registered: 4/17/07
Re: quick way to calculate standard deviation of multiple images
Posted: Oct 10, 2012 8:33 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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 pre-allocate 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





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.