I want determine the picture with the highest mean from a set of images loaded
into matlab as matrix. The code is below. I want to know the exact picture with
the highest mean so as to make it as a basis for further calculation.this
picture should be printed.

for k = 1:length(jpegFiles) % loop to run large number of pictures

filename = jpegFiles(k).name;

data = imread(filename);

y = mean(mean(data));

end

# Determine mean from set of images

Started by ●August 7, 2009

Reply by ●August 9, 20092009-08-09

--- In i..., colenajayi@... wrote:

>

> I want determine the picture with the highest mean from a set of images loaded into matlab as matrix. The code is below. I want to know the exact picture with the highest mean so as to make it as a basis for further calculation.this picture should be printed.

>

> for k = 1:length(jpegFiles) % loop to run large number of pictures

> filename = jpegFiles(k).name;

> data = imread(filename);

> y = mean(mean(data));

> end

>

How about you try this...

y = 0;

for k = 1:length(jpegFiles) % loop to run large number of pictures

filename = jpegFiles(k).name;

data = imread(filename);

k = mean(mean(data));

if(k>y) y = k;

end

Then y will be your desired result...Khalid Gidaya

>

> I want determine the picture with the highest mean from a set of images loaded into matlab as matrix. The code is below. I want to know the exact picture with the highest mean so as to make it as a basis for further calculation.this picture should be printed.

>

> for k = 1:length(jpegFiles) % loop to run large number of pictures

> filename = jpegFiles(k).name;

> data = imread(filename);

> y = mean(mean(data));

> end

>

How about you try this...

y = 0;

for k = 1:length(jpegFiles) % loop to run large number of pictures

filename = jpegFiles(k).name;

data = imread(filename);

k = mean(mean(data));

if(k>y) y = k;

end

Then y will be your desired result...Khalid Gidaya

Reply by ●August 12, 20092009-08-12

Thanks guys.

The advice was very helpful.

Regards,

Kay

On Sat, Aug 8, 2009 at 3:58 AM, Khalid Gidaya wrote:

> --- In i... , colenajayi@...

> wrote:

> >

> > I want determine the picture with the highest mean from a set of images

> loaded into matlab as matrix. The code is below. I want to know the exact

> picture with the highest mean so as to make it as a basis for further

> calculation.this picture should be printed.

> >

> > for k = 1:length(jpegFiles) % loop to run large number of pictures

> > filename = jpegFiles(k).name;

> > data = imread(filename);

> > y = mean(mean(data));

> > end

> > How about you try this...

> y = 0;

> for k = 1:length(jpegFiles) % loop to run large number of pictures

> filename = jpegFiles(k).name;

> data = imread(filename);

> k = mean(mean(data));

> if(k>y) y = k;

> end

>

> Then y will be your desired result...Khalid Gidaya

>

>

>

The advice was very helpful.

Regards,

Kay

On Sat, Aug 8, 2009 at 3:58 AM, Khalid Gidaya wrote:

> --- In i... , colenajayi@...

> wrote:

> >

> > I want determine the picture with the highest mean from a set of images

> loaded into matlab as matrix. The code is below. I want to know the exact

> picture with the highest mean so as to make it as a basis for further

> calculation.this picture should be printed.

> >

> > for k = 1:length(jpegFiles) % loop to run large number of pictures

> > filename = jpegFiles(k).name;

> > data = imread(filename);

> > y = mean(mean(data));

> > end

> > How about you try this...

> y = 0;

> for k = 1:length(jpegFiles) % loop to run large number of pictures

> filename = jpegFiles(k).name;

> data = imread(filename);

> k = mean(mean(data));

> if(k>y) y = k;

> end

>

> Then y will be your desired result...Khalid Gidaya

>

>

>