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.
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.
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.
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.