Re: Populating a matrix with pixel values
- From: "m. k" <mkawika@xxxxxxxxxxxxx>
- Date: Tue, 31 Jul 2007 17:34:14 +0000 (UTC)
thanks for the help. i have another question though. how do i reshape the matrix if in your code, the '1:25' values were placed with pixel intensity values pulled from specific x and y coordinates from an image? Would you know how to pull those pixel values from an image and reshape them?
thanks,
m.k.
"us " <us@xxxxxxxxxxxxxxx> wrote in message <f8nqrp$g01$1@xxxxxxxxxxxxxxxxxx>...
m. k:
<SNIP extracting data from an image...
one of the solutions
% the image
img=reshape(1:25,[5,5]);
rc=2; % submat center: row
cc=4; % submat center: col
ms=3; % submat size: 3x3 == odd
% the engine
ns=floor(ms/2);
% ...error checking comes here!
m=img(rc-ns:rc+ns,cc-ns:cc+ns);
% the result
img
m
us
.
- References:
- Populating a matrix with pixel values
- From: m. k
- Re: Populating a matrix with pixel values
- From: us
- Populating a matrix with pixel values
- Prev by Date: Re: Generating random numbers on unit sphere
- Next by Date: Re: Generating random numbers on unit sphere
- Previous by thread: Re: Populating a matrix with pixel values
- Next by thread: sell jordan 3 jordan4 jordan5 jordan7 jordan8 jordan11 shoes on www.nikestares.com
- Index(es):