From: Walter Roberson on
jatin mistry wrote:

> i tried what u have suggested but
> it still gives the same error...
> ??? Subscripted assignment dimension mismatch.
>
> Error in ==> stitchSequential at 19
> thisimage = double(imread([directory '/' imageName ]));

I don't know. I would break this into parts. Put a breakpoint in at that
line, and then type in debugging commands at the command line...

T1 = imread([directory '/' imageName ]);
size(T1)
class(T1)
T2 = double(T1);
size(T2)
class(T2)
thisimage = T2;
class(thisimage)

This is not suggested replacement code: this is just breaking the line
down in to pieces so that you can figure out exactly which step triggers
the error.
From: jatin mistry on
Walter Roberson <roberson(a)hushmail.com> wrote in message <hqcvcc$e0r$1(a)canopus.cc.umanitoba.ca>...
> jatin mistry wrote:
>
> > i tried what u have suggested but
> > it still gives the same error...
> > ??? Subscripted assignment dimension mismatch.
> >
> > Error in ==> stitchSequential at 19
> > thisimage = double(imread([directory '/' imageName ]));
>
> I don't know. I would break this into parts. Put a breakpoint in at that
> line, and then type in debugging commands at the command line...
>
> T1 = imread([directory '/' imageName ]);
> size(T1)
> class(T1)
> T2 = double(T1);
> size(T2)
> class(T2)
> thisimage = T2;
> class(thisimage)
>
> This is not suggested replacement code: this is just breaking the line
> down in to pieces so that you can figure out exactly which step triggers
> the error.


actually on trying my code in a debugger step by step,the for loop runs once...making f=2....then it stores imageName and directory with the next items in the specified folder...
the code gives the error when it executes this:
Mosaic(:,:,:,f) = double(imread([directory '/' imageName ]));

thus the above line is executed only once before giving an error....while the rest upper code in the for loop gets executed twice....
i.e my code accepts one image data.....
but does not accept second image data in the second iteration of the for loop and generates an errror...

thanks for the suggestions and help...
is there any other way in which i can store my various image data into....example a cell or structure....
do reply if such a method exists..so that 2 to 3 images can be stored sequentially...

Again thanks for ur suggestion and valuable time to look into the problem...
Regards
Jatin.

From: Walter Roberson on
jatin mistry wrote:

> actually on trying my code in a debugger step by step,the for loop runs
> once...making f=2....then it stores imageName and directory with the
> next items in the specified folder...
> the code gives the error when it executes this:
> Mosaic(:,:,:,f) = double(imread([directory '/' imageName ]));
>
> thus the above line is executed only once before giving an
> error....while the rest upper code in the for loop gets executed twice....
> i.e my code accepts one image data.....
> but does not accept second image data in the second iteration of the for
> loop and generates an errror...

That's exactly the behaviour I would expect if the image is not exactly
the same size as the first and if you did not use my suggested code that
saves the image into a temporary variable, calculates the size of the
new image, and then uses explicit subscripts to write the image into
Mosaic .

> is there any other way in which i can store my various image data
> into....example a cell or structure....

Of course. Either could be used.

Mosaic{f} = double(imread([directory '/' imageName ]));
From: ImageAnalyst on
I didn't go over your cod eline by line but it appears that you are
trying to reinvent the "montage()" function of the image processing
toolbox. Alternatively you can use imdisp by Oliver Woodford:
http://www.mathworks.com/matlabcentral/fileexchange/22387-imdisp
So my recommendation would be to use one of those and abandon your
method, unless they don't do what you want for some reason.