I am not able to reconstruct back into the whole image which is needed as per the algorithm in order to perform other operations. So plz suggest some command or technique.
a=VideoReader('test.mp4 '); b = read(a,1 ); c=rgb2gray(b ); nframe=a.NumberOfFrames ; for i=115:116 prev_frame =read(a,i-1 ); e=rgb2gray(prev_frame ); figure imshow(e ); pause(0.2) current_frame =read(a,i); h=rgb2gray(current_frame ); figure imshow(h); rows = 8 ; columns = 8 ; [H,W,~] = size(c ); szH = [repmat(fix(H/rows),1,rows )]; szW = [repmat(fix(W/columns),1,columns )]; //to split into window size of 8x8 as per my algorithm C = mat2cell(e, szH, szW )'; D = mat2cell(h, szH, szW )'; figure for j=1:rows*columns subplot(rows,columns,j), imshow( C{j } ) //to plot above cells end figure for j=1:rows*columns subplot(rows,columns,j), imshow( D{j } ) end for k=1:1*8 o=1:1*8 G=cell2mat(C(k,o)'); figure imshow(G);at this point i am getting images which i am not able to recombine.kindly suggest something here end for k=1:8 o=1:8 H=cell2mat(D(k,o)'); figure imshow(H); end w=std(double(G)); figure plot(w); b=std(double(H)); figure plot(b); level=graythresh(G); level=graythresh(H); if level>level1 T=im2bw(G); figure imshow(T); else P=im2bw(H); figure imshow(P); end end
Best Answer