3D image from 10rgb slices

4 visualizzazioni (ultimi 30 giorni)
Sermed
Sermed il 25 Gen 2013
Hi I have 10 rgb images (100x 100x 3) and want to combine them into a single 3D image. Is it possible ? thanks in advance Sermed
  1 Commento
Image Analyst
Image Analyst il 26 Gen 2013
So which of the two methods below is what you want?

Accedi per commentare.

Risposte (3)

Image Analyst
Image Analyst il 25 Gen 2013
How do you want to combine them? Do you want a single x00x100x3 image that is the average of all of them? If so, cast them to double and add them, then cast back to uint8 (if that's how they started).
aveImage = uint8((double(image1) + double(image2) + ... + double(image10))/10);

Thorsten
Thorsten il 25 Gen 2013
Because RGB is already 3D, you can combine them in the fourth dimension
I1 = ones(10, 10, 3);
I2 = 2*ones(10, 10, 3);
All(:,:,:,1) = I1;
All(:,:,:,2) = I2;
or you can stack them one after the other in the third dimension:
All(:,:,1:3) = I1;
All(:,:,4:6) = I2;
or you can use cells
All{1} = I1;
All{2} = I2;

Youssef  Khmou
Youssef Khmou il 27 Gen 2013
Hi, here is an other viewpoint that combines the two given answers : you create an Image_Stack and then do what you prefer like median, mean ... :
Stack=zeros(100,100,3,10);
% ur first image I1
Stack(:,:,:,1)=im2double(I1);
%..and so on until 10
Stack(:,:,:,10)=im2double(I10);
Sum=zeros(100,100,3);
for iter=1:10
Sum=Sum+Stack(:,:,:,iter);
end Combined=Sum/10;
I hope that helps .
KH.Youssef

Categorie

Scopri di più su Image Processing Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by