From: Image Analyst on
Sami Oueslati
I understood perfectly (I believe) and I told you how to do it.
You know the starting and ending rows and columns, so just extract out each sub image and get the mean with the mean() function. What about this makes it seem like I didn't understand?
ImageAnalyst
From: Sami Oueslati on
"Image Analyst" <imageanalyst(a)mailinator.com> wrote in message <hr5cov$k2s$1(a)fred.mathworks.com>...
> Sami Oueslati
> I understood perfectly (I believe) and I told you how to do it.
> You know the starting and ending rows and columns, so just extract out each sub image and get the mean with the mean() function. What about this makes it seem like I didn't understand?
> ImageAnalyst
oh yes! sorry I was confused, it's because sometimes I worry about my poor english...Now I see what you mean...Thank you :)
From: Sami Oueslati on
"Sami Oueslati" <Samyw69(a)yahoo.fr> wrote in message <hr5dfg$4j1$1(a)fred.mathworks.com>...
> "Image Analyst" <imageanalyst(a)mailinator.com> wrote in message <hr5cov$k2s$1(a)fred.mathworks.com>...
> > Sami Oueslati
> > I understood perfectly (I believe) and I told you how to do it.
> > You know the starting and ending rows and columns, so just extract out each sub image and get the mean with the mean() function. What about this makes it seem like I didn't understand?
> > ImageAnalyst
> oh yes! sorry I was confused, it's because sometimes I worry about my poor english...Now I see what you mean...Thank you :)


Something else please,
How to put the mean values obtained, in an array where each value corresponds each subimage...I mean every subimage is replaced by the mean value obtained to finally have a representative array of the original image.... hope it's clear...
From: ImageAnalyst on
On Apr 26, 9:09 pm, "Sami Oueslati" <Samy...(a)yahoo.fr> wrote:
> oh yes! sorry I was confused, it's because sometimes I worry about my poor english...Now I see what you mean...Thank you :)
---------------------------------------------------------------------
Just in case you don't, here's a demo:
I don't know the actual rows and columns so I'm just doing it with a
subimage size of 100 by 100:

clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
imtool close all; % Close all imtool figures.
clear; % Erase all existing variables.
workspace; % Make sure the workspace panel is showing.

% Change the current folder to the folder of this m-file.
% (The line of code below is from Brett Shoelson of The Mathworks.)
if(~isdeployed)
cd(fileparts(which(mfilename)));
end

% Read in standard MATLAB grayscale demo image.
fullFileName = 'image avec grille.jpg';
grayImage = imread(fullFileName);
grayImage = rgb2gray(grayImage);
subplot(6, 4, 1);
imshow(grayImage, []);
title('Original Grayscale Image');
set(gcf, 'Position', get(0,'Screensize')); % Enlarge figure to full
screen.
[rows cols numberOfColorbands] = size(grayImage)
counter = 0;
for col = 1:100:cols-100
for row = 1:100:rows-100
subImage = grayImage(row:row+99, col:col+99);
subplot(6, 4, counter+2);
imshow(subImage, []);
meanGrayLevel = mean(subImage(:))
counter = counter + 1
caption = sprintf('Mean = %.1f', meanGrayLevel);
title(caption);
end
end


From: ImageAnalyst on
On Apr 26, 9:23 pm, "Sami Oueslati" <Samy...(a)yahoo.fr> wrote:
> How to put the mean values obtained, in an array where each value corresponds each subimage...I mean every subimage is replaced by the mean value obtained to finally have a representative array of the original image.... hope it's clear...
----------------------------------------------------------------------
counter = 0;
for col = 1:100:cols-100
for row = 1:100:rows-100
subImage = grayImage(row:row+99, col:col+99);
subplot(6, 4, counter+2);
imshow(subImage, []);
meanGrayLevel(counter+1) = mean(subImage(:))
counter = counter + 1
caption = sprintf('Mean = %.1f', meanGrayLevel(counter+1));
title(caption);
end
end