Thread Subject: Basic Image Processing

Subject: Basic Image Processing

From: Joe Frank

Date: 9 Nov, 2009 02:37:01

Message: 1 of 4

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?

Subject: Basic Image Processing

From: jonny

Date: 9 Nov, 2009 02:45:23

Message: 2 of 4

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.

Subject: Basic Image Processing

From: Joe Frank

Date: 9 Nov, 2009 03:17:03

Message: 3 of 4

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?

Subject: Basic Image Processing

From: Novae

Date: 9 Nov, 2009 16:08:02

Message: 4 of 4

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?

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com