From: astro mmi on 8 Jul 2010 04:30 Hi everyone, In the following code I am trying to divide an image into 8*8 blocks and then in each block I am treating every row as a sequence of samples in order to find its z-transform. The resulting data is processed through several stages and then we take IZT. Pls let me know how I can take the z-tranform of each such row in every block. Thanks in advance. i=imread('rice.png'); figure, imshow(i) sizeim=size(i); %Dividing the image into 8*8 blocks blksiz=[8 8]; %block size nob=ceil(sizeim./blksiz); %number of blocks in each dimension C = mat2cell(i,repmat(blksiz(1),1,nob(1)), repmat(blksiz(2),1,nob(2))); %Each cell is an 8*8 array dividing i into 'nob' 8*8 blocks; for blkr=1:nob(1) for blkc=1:nob(2) A=C{i,j}; for t=1:blksiz(1) A(t,:)=ztransform(A(t,:)/max(A(t,:))); end C{i,j}=A; end end
|
Pages: 1 Prev: problem with opening MatLab editor Next: Load time series in matlab matrix |