From: mops zaki on
hello i have to normalize the image .for this first i have to find ot the mean an variance of the image..Size my image is 240*320 .
i calculate mean using M=mean(image)
and variance V=var(image) as it is given in matlab help but is is not working
error message disply

""??? Error using ==> minus
Integers can only be combined with integers of the same class, or scalar doubles.

Error in ==> var at 84
x0 = x - repmat(xbar, tile);

Error in ==> paper1 at 11
V=VAR(I5)""
please help me
From: Walter Roberson on
mops zaki wrote:
> hello i have to normalize the image .for this first i have to find ot
> the mean an variance of the image..Size my image is 240*320 .
> i calculate mean using M=mean(image)

mean() applies in only one direction at a time. To calculate the mean of
the entire image, you need M = mean(image(:))

> and variance V=var(image) as it is given in matlab help but is is not
> working
> error message disply
>
> ""??? Error using ==> minus
> Integers can only be combined with integers of the same class, or scalar
> doubles.
>
> Error in ==> var at 84
> x0 = x - repmat(xbar, tile);
>
> Error in ==> paper1 at 11
> V=VAR(I5)""

mean() has been programmed to take into account different data classes.
var() has not. Try

V = var(double(image(:)))

Notice, by the way, that var, like mean, only works in one direction at
a time.
From: mops zaki on
Walter Roberson <roberson(a)hushmail.com> wrote in message <hqutkt$h22$2(a)canopus.cc.umanitoba.ca>...
> mops zaki wrote:
> > hello i have to normalize the image .for this first i have to find ot
> > the mean an variance of the image..Size my image is 240*320 .
> > i calculate mean using M=mean(image)
>
> mean() applies in only one direction at a time. To calculate the mean of
> the entire image, you need M = mean(image(:))
>
> > and variance V=var(image) as it is given in matlab help but is is not
> > working
> > error message disply
> >
> > ""??? Error using ==> minus
> > Integers can only be combined with integers of the same class, or scalar
> > doubles.
> >
> > Error in ==> var at 84
> > x0 = x - repmat(xbar, tile);
> >
> > Error in ==> paper1 at 11
> > V=VAR(I5)""
>
> mean() has been programmed to take into account different data classes.
> var() has not. Try
>
> V = var(double(image(:)))
>
> Notice, by the way, that var, like mean, only works in one direction at
> a time.
From: mops zaki on
Walter Roberson <roberson(a)hushmail.com> wrote in message <hqutkt$h22$2(a)canopus.cc.umanitoba.ca>...
> mops zaki wrote:
> > hello i have to normalize the image .for this first i have to find ot
> > the mean an variance of the image..Size my image is 240*320 .
> > i calculate mean using M=mean(image)
>
> mean() applies in only one direction at a time. To calculate the mean of
> the entire image, you need M = mean(image(:))
>
> > and variance V=var(image) as it is given in matlab help but is is not
> > working
> > error message disply
> >
> > ""??? Error using ==> minus
> > Integers can only be combined with integers of the same class, or scalar
> > doubles.
> >
> > Error in ==> var at 84
> > x0 = x - repmat(xbar, tile);
> >
> > Error in ==> paper1 at 11
> > V=VAR(I5)""
>
> mean() has been programmed to take into account different data classes.
> var() has not. Try
>
> V = var(double(image(:)))
>
> Notice, by the way, that var, like mean, only works in one direction at
> a time.


hello sir
thanx for ur reply
sir after usig this function size of image reduce to 1x1 now what
either i have to convolve it or ....
because i have to multibly the mean image with original one

thnx
From: ImageAnalyst on
What mean image? You have the mean value of ONE image over all pixels
in that one image, which is a scalar. What got reduced? You still
have your original image at its original size. So just multiply the
scalar by the array and you get what you want. WHY you want this
baffles me. What use could this possibly have?

And why do you say you want to multiply the "mean image" by the
"original one"? You DON"T HAVE a mean image unless you take the mean
of SEVERAL images. And again, what possible use could that have?