How to extract RGB matrices from stacked TIFF file?
Mostra commenti meno recenti
I have a (512x512x3xN) image array where 3 corresponds to the R,G,B channels, and N corresponds to the number of images. How can I extract the R,G,B channels from each image?
I will eventually want to compute mean and stdev for each R,G,B channel of each of the N images and put these into a txt file.
Thanks
Risposta accettata
Più risposte (1)
hosein Javan
il 13 Ago 2020
Modificato: hosein Javan
il 13 Ago 2020
not sure.
% A = your matrix after reading the image file
im = cell(1,n);
for i = 1:N
im{i} = A(:,:,:,i) % im{i} = individual image number(i)
end
6 Commenti
iontrap
il 13 Ago 2020
hosein Javan
il 13 Ago 2020
A = imread('My TIFF.tiff');
ndims(a) % check if it is 4
N = size(a,4) % number of frames
im = cell(1,N);
for i = 1:N
im{i} = A(:,:,:,i) % im{i} = individual image number(i)
end
iontrap
il 13 Ago 2020
hosein Javan
il 13 Ago 2020
sorry it's A
iontrap
il 14 Ago 2020
hosein Javan
il 14 Ago 2020
you're welcome, good luck.
Categorie
Scopri di più su Image Data in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!