Show stacked images in 3D
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Subhadeep Koley
le 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?
Réponses (1)
Voir également
Catégories
En savoir plus sur Image Preview and Device Configuration dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!