Prev: How to change 3 dim into 2dim
Next: Wasteful replication of non-cell data in a struct containing acell array
From: th on 14 May 2010 06:58 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 14 May 2010 07:08 "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 14 May 2010 07:17 "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 14 May 2010 07:29 "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 14 May 2010 07:39 "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);
|
Next
|
Last
Pages: 1 2 Prev: How to change 3 dim into 2dim Next: Wasteful replication of non-cell data in a struct containing acell array |