From: Sami Oueslati on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <6bdc1204-a744-441d-a2c0-4a41e263c768(a)q8g2000vbm.googlegroups.com>...
> Just use regular indexing. You can find the rows and columns of the
> black lines dividing the subimages, can't you? Then do
> imageArray = fullSizeImage(row1:row2, col1:col2);
> meanGrayValue = mean(imageArray(:));
--------------------------------------------------------

If I have the coordinates of the horizontal black lines in the vector "H".
If I have the coordinates of the vertical black lines in the vector "V".

supposing:
X : original image
Y1...Yn : subimages

How to make an iterative program to determine the subimages automatically?
Is it on this way???

Y1 = X (1:H(1), 1:V(1));
Y2 = X (1:H(1), V(1):V(2));
....
Yk = X (H(1):H(2), 1:V(1)); How to pass from 1:H(1) to H(1):H(2)??
....
Yn = X(H(n):size(X,1), V((n):size(X,2));

Hope you see what I mean..
From: ImageAnalyst on
Just do what I did above except the for loops will look like:
for col = H
for row = V
% extract subimage....
end
end
From: Sami Oueslati on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <7c9fe192-effc-48c8-8de5-ccff825788bf(a)x3g2000yqd.googlegroups.com>...
> Just do what I did above except the for loops will look like:
> for col = H
> for row = V
> % extract subimage....
> end
> end
-------------------------------------------------------------------------------------
Hi ImageAnalyst,
I've been trying to solve the problem following what you wrote but I didn't arrive to good results. Please, review what I want to do.

I show you the image again
http://drop.io/mqlwmho#

I remember you that I must calculate the gray level of the center of each rectangular region formed by the grid (the vector "H" contains the coordinates of the horizontal black lines. the vector "V" contains the coordinates of the vertical black lines).

Then I want to regroup the gray levels obtained in a matrix that has the size (Number of regions in the row direction x number if regions in column direction).

My problem is the starting of the loops:
for ii=1:H:size(grayImage,1)
for jj=1:V:size(grayImage,2)

But it doesn't work...
Hope you'll help me.
From: Sami Oueslati on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <7c9fe192-effc-48c8-8de5-ccff825788bf(a)x3g2000yqd.googlegroups.com>...
> Just do what I did above except the for loops will look like:
> for col = H
> for row = V
> % extract subimage....
> end
> end
-----------------------------------------------------------------------------
Hi ImageAnalyst,

Please help me to solve this problem... I don't know which indexes I must use for the loops
http://drop.io/mqlwmho#
I need to extract the gray values of the centers of each region and put the results on a matrix that has the dimensions (regions on vertical axis X regions on horizontal axis)

I must achieve my work in two weeks...so I haven't too much time....
Please, You are my last chance...
From: ImageAnalyst on
On May 8, 9:55 pm, "Sami Oueslati" <Samy...(a)yahoo.fr> wrote:
> Hi ImageAnalyst,
>
> Please help me to solve this problem... I don't know which indexes I must use for the loopshttp://drop.io/mqlwmho#
> I need to extract the gray values of the centers of each region and put the results on a matrix that has the dimensions (regions on vertical axis X regions on horizontal axis)
>
> I must achieve my work in two weeks...so I haven't too much time....
> Please, You are my last chance...
--------------------------------------------------------------------------------------------
Why don't you post the original image? All those annotation and tick
marks are really complicating things. Plus the jpegging is blurring
the lines. Post the original, uncompressed image that you put into
the figure. It should be a png, tif, or bmp format image. The figure
itself is no good - we don't want the title, and all the numbers, tick
marks, etc.

Here's a hint:

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.
fontSize = 20;

% 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 color jpg demo image.
folder = 'C:\Documents and Settings\user\My Documents\Temporary
stuff';
fullFileName = fullfile(folder, 'grille.jpg');
rgbImage = imread(fullFileName);
grayImage = rgb2gray(rgbImage);
subplot(2, 2, 1);
imshow(grayImage, []);
title('Original Grayscale Image');
set(gcf, 'Position', get(0,'Screensize')); % Enlarge figure to full
screen.

binaryImage = grayImage < 10;
subplot(2, 2, 2);
imshow(binaryImage, []);
title('Binary Image');

verticalProfile = sum(grayImage, 2);
subplot(2, 2, 3);
plot(verticalProfile);
title('Vertical Profile');

horizontalProfile = sum(grayImage, 1);
subplot(2, 2, 4);
plot(horizontalProfile);
title('Horizontal Profile');