필터 지우기
필터 지우기

3D image from 10rgb slices

조회 수: 1 (최근 30일)
Sermed
Sermed 2013년 1월 25일
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
Image Analyst
Image Analyst 2013년 1월 26일
So which of the two methods below is what you want?

댓글을 달려면 로그인하십시오.

답변 (3개)

Image Analyst
Image Analyst 2013년 1월 25일
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 2013년 1월 25일
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 2013년 1월 27일
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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by