Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Basic Image Processing
Date: Mon, 9 Nov 2009 16:08:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 40
Message-ID: <hd9ep2$g5h$1@fred.mathworks.com>
References: <hd7v8d$8vk$1@fred.mathworks.com> <e0176e1c-3cfb-4a59-81ed-6ede6dc961d7@j19g2000vbp.googlegroups.com> <hd81je$2b9$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257782882 16561 172.30.248.37 (9 Nov 2009 16:08:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 9 Nov 2009 16:08:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 559256
Xref: news.mathworks.com comp.soft-sys.matlab:583585


Hi Joe

im1 and im2 look like vectors (nx1 matrices...)
Anyway, assuming that you have this images:

im1 is 200x200 matrix
im2 is 300x300 matrix

You can only add 2 images if they are of the same size. So re-size the smaller one to a 300x300 matrix. This way you will avoid information loss since you can't create completely new from existing one. For this use:

im2=imresize(im2, [300, 300]);

There are several algorithms for resizing. Check the options on imresize help.

Now you should have similar images and you can add them (if you have the image processing toolbox):

NewImage=imadd(im1, im2);

Once again check the imadd help for more tips and troubleshooting.

I hope this can do the trick... 
If you don't have the image processing toolbox... hum... it will be hard.

Igor


"Joe Frank" <sascod@gmail.com> wrote in message <hd81je$2b9$1@fred.mathworks.com>...
> jonny <jonnazemi@gmail.com> wrote in message <e0176e1c-3cfb-4a59-81ed-6ede6dc961d7@j19g2000vbp.googlegroups.com>...
> > On Nov 8, 9:37?pm, "Joe Frank" <sas...@gmail.com> wrote:
> > > I have two images.. im1 and im2
> > >
> > > im1 is 1200x1 matrix
> > > im2 is 1450x1 matrix
> > >
> > > I want to add im1 and im2 for further calculation. How do I do it?
> > 
> > you need to interpolate one over the range of the other. I would
> > interpolate the 1450 over the 1200 range.
> 
> How do I interpolate them?