Subtracting velues in cell
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a code
for xx = 1:length(dirlist(1))
x = imread([pathname, dirlist(xx).name]);
x=rgb2gray(x);
x=imresize(x,[256 256]);
C = mat2cell(x,[128 128],[128 128]);
end
for xx = 1:length(dirlist)
x = imread([pathname, dirlist(xx).name]);
x=rgb2gray(x);
x=imresize(x,[256 256]);
C1 = mat2cell(x,[128 128],[128 128]);
,,,,,,,,,,
,,,,,,,,,,
,,,,,,,,,,
end
I want to subtract values in C and C1,in dirlist I have 50 Images..I have taken reference frame and subtracted with other frames ..after C1 ,i want to subtract C with C1,please help
0 commentaires
Réponse acceptée
Matt J
le 3 Oct 2012
The best thing would be to subtract first and do MAT2CELL second:
for xx = 1:length(dirlist(1))
x = imread([pathname, dirlist(xx).name]);
x=rgb2gray(x);
C=imresize(x,[256 256]);
end
for xx = 1:length(dirlist)
x = imread([pathname, dirlist(xx).name]);
x=rgb2gray(x);
C1=imresize(x,[256 256]);
end
D=mat2cell(C-C1,[128,128],[128,128]);
Alternatively, you can use CELLFUN:
D=cellfun(@(a,b) a-b, C1, C2, 'uni',0);
2 commentaires
Matt J
le 3 Oct 2012
If it works for 1 image, then why not just repeat the procedure in a loop to do all 50.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!