Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Mean of an image

Subject: Mean of an image

From: shilpa khinvasara

Date: 28 Jul, 2010 05:13:04

Message: 1 of 2

can u pls check the following code for the mean of the image

[s t]=size(q);
ss=s(1);
y=zeros(ss);
i=1;j=1;
for n=1:1:t
    for m=1:1:s
        y(m,n)=q(i,j);
        i=i+1;
    end;
    i=1;
    j=j+1;
end
h1=[1 1 1;1 1 1;1 1 1];
a1=conv2(y,h1);
%mea = mean(mean(a1));
figure;
subplot(2,2,1);
imshow(x);
subplot(2,2,2);
imshow(a1);
subplot(2,2,3);

hist(a1(:),max(a1(:)));

Subject: Mean of an image

From: Airballman

Date: 28 Jul, 2010 07:01:06

Message: 2 of 2

"shilpa khinvasara" <ship@gamil.com> wrote in message <i2oe90$44v$1@fred.mathworks.com>...
> can u pls check the following code for the mean of the image
>
> [s t]=size(q);
> ss=s(1);
> y=zeros(ss);
> i=1;j=1;
> for n=1:1:t
> for m=1:1:s
> y(m,n)=q(i,j);
> i=i+1;
> end;
> i=1;
> j=j+1;
> end
> h1=[1 1 1;1 1 1;1 1 1];
> a1=conv2(y,h1);
> %mea = mean(mean(a1));
> figure;
> subplot(2,2,1);
> imshow(x);
> subplot(2,2,2);
> imshow(a1);
> subplot(2,2,3);
>
> hist(a1(:),max(a1(:)));

Hi,

What would be the problem with the function mean2 ?

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us