Show stacked images in 3D

4 views (last 30 days)
VO
VO on 6 Jan 2020
Answered: Selva Karna on 9 Jan 2020
Hello everyone,
I have two set of binary images (school and work) which I can succesfully display together. My code below shows the two dataset together (each with a different color) and where they intercept as a combination of the colors used.
I will also like to visualize the display the results of my work in a 3D format and need some help.
Here is a look at my code;
%IMPORTING SCHOOL IMAGES
%Create path to folder with the images,
mySCHOOL = 'location1';
% Get a list of all files in the folder with the desired file name pattern.
schoolPattern = fullfile(mySCHOOL, '*.png'); % Change to whatever pattern you need.
schoolFiles = dir(SCHOOLPattern);
%IMPORTING WORK IMAGES
%Create path to folder with the images,
myWORK = 'location2';
% Get a list of all files in the folder with the desired file name pattern.
workPattern = fullfile(myWORK, '*.png'); % Change to whatever pattern you need.
workFiles = dir(WORKPattern);
figure (1)
for i=1:length(schoolFiles)
schoolbaseFileName = schoolFiles(i).name;
schoolfullFileName = fullfile(mySCHOOL, schoolbaseFileName);
fprintf(1, 'Now reading %s\n', schoolfullFileName);
schoolimageArray = imread(schoolfullFileName);
workbaseFileName = neutronFiles(i).name;
workfullFileName = fullfile(myWORK, workbaseFileName);
fprintf(1, 'Now reading %s\n', workfullFileName);
workimageArray = imread(workfullFileName);
xx=double(schoolimageArray./255);
yy=double(workimageArray*0);
zz=double(workimageArray./255);
RGB=cat(3,xx,yy,zz);
imshow(squeeze(RGB(:,:,:,:)));
drawnow;
end
  1 Comment
Subhadeep Koley
Subhadeep Koley on 9 Jan 2020
Hi Victor, can you clarify what your expected output is. Are you expecting M*N*3 dimentional image? Also can you share some of your data?

Sign in to comment.

Answers (1)

Selva Karna
Selva Karna on 9 Jan 2020
volshow(your 3d)

Products

Community Treasure Hunt

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

Start Hunting!