From: th on
hallo there.

I want to put a matrix that is 128X128 in a matrix that is 512X512 ( ones(512) ).

what I want to do is to have the white image and above to put the second image ( a letter, A for example).

I cant multiply cause they dont have the same dimensions.


any ideas??




thanks in advance
From: us on
"th " <THOMITSU(a)YAHOO.COM> wrote in message <hsjabs$bbc$1(a)fred.mathworks.com>...
> hallo there.
>
> I want to put a matrix that is 128X128 in a matrix that is 512X512 ( ones(512) ).
>
> what I want to do is to have the white image and above to put the second image ( a letter, A for example).
>
> I cant multiply cause they dont have the same dimensions.
>
>
> any ideas??
>
>
>
>
> thanks in advance

one of the many solutions

sm=magic(2);
bm=zeros(6,'double');
bm(3:4,3:4)=sm
%{
% bm =
0 0 0 0 0 0
0 0 0 0 0 0
0 0 1 3 0 0
0 0 4 2 0 0
0 0 0 0 0 0
0 0 0 0 0 0
%}

us
From: th on
"th " <THOMITSU(a)YAHOO.COM> wrote in message <hsjabs$bbc$1(a)fred.mathworks.com>...
> hallo there.
>
> I want to put a matrix that is 128X128 in a matrix that is 512X512 ( ones(512) ).
>
> what I want to do is to have the white image and above to put the second image ( a letter, A for example).



that wasnt exactly what i meant..

I1=imread('Aneg.tif'); % this is the image with the letter
I1=double(I1);
I1=1-I1; % i make it with a white background and the letter is black

I1=imresize(I1,0.25); % I resize it

figure(1); imshow(I1,[]);

I2=ones(512) ;

and now what i want to do is to put I1 on I2. i want to have a smaller image in a bigger image, so I can have my small letter in a big white background

cant multiply though...

ideas??
From: us on
"th " <THOMITSU(a)YAHOO.COM> wrote in message <hsjbfg$n2e$1(a)fred.mathworks.com>...
> "th " <THOMITSU(a)YAHOO.COM> wrote in message <hsjabs$bbc$1(a)fred.mathworks.com>...
> > hallo there.
> >
> > I want to put a matrix that is 128X128 in a matrix that is 512X512 ( ones(512) ).
> >
> > what I want to do is to have the white image and above to put the second image ( a letter, A for example).
>
>
>
> that wasnt exactly what i meant..
>
> I1=imread('Aneg.tif'); % this is the image with the letter
> I1=double(I1);
> I1=1-I1; % i make it with a white background and the letter is black
>
> I1=imresize(I1,0.25); % I resize it
>
> figure(1); imshow(I1,[]);
>
> I2=ones(512) ;
>
> and now what i want to do is to put I1 on I2. i want to have a smaller image in a bigger image, so I can have my small letter in a big white background
>
> cant multiply though...
>
> ideas??

why should the solution shown above not work(?)...

us
From: Sean on
"th " <THOMITSU(a)YAHOO.COM> wrote in message <hsjbfg$n2e$1(a)fred.mathworks.com>...
> "th " <THOMITSU(a)YAHOO.COM> wrote in message <hsjabs$bbc$1(a)fred.mathworks.com>...
> > hallo there.
> >
> > I want to put a matrix that is 128X128 in a matrix that is 512X512 ( ones(512) ).
> >
> > what I want to do is to have the white image and above to put the second image ( a letter, A for example).
>
>
>
> that wasnt exactly what i meant..
>
> I1=imread('Aneg.tif'); % this is the image with the letter
> I1=double(I1);
> I1=1-I1; % i make it with a white background and the letter is black
>
> I1=imresize(I1,0.25); % I resize it
>
> figure(1); imshow(I1,[]);
>
> I2=ones(512) ;
>
> and now what i want to do is to put I1 on I2. i want to have a smaller image in a bigger image, so I can have my small letter in a big white background
>
> cant multiply though...
>
> ideas??

What us said will work, you're just going to have to think about it a little.
Another way:
>>A= magic(128);
>>B = padarray(A,[floor((512-128)/2) floor((512-128)/2)], 1);