Effacer les filtres
Effacer les filtres

how to access first subimage from mat2cell when it is divided into 8x8 images?

1 vue (au cours des 30 derniers jours)
ramya
ramya le 15 Mar 2018
Modifié(e) : ramya le 15 Mar 2018
suppose we have image which is split into 8x8 subimages by using mat2cell. now i have to access first subimage from this 8x8 cells. how to do this.suggest some code
  2 commentaires
Birdman
Birdman le 15 Mar 2018
Can you share your code?
ramya
ramya le 15 Mar 2018
Modifié(e) : ramya le 15 Mar 2018
a=VideoReader('test.mp4 ');
b = read(a,1 );
c=rgb2gray(b );
nframe=a.NumberOfFrames ;
for i=115
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
end
here is the code now i have to access C{1},C{2} and so on to perform std on each subimage

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Scripts dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by