Show stacked images in 3D
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
Subhadeep Koley
2020-1-9
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?
回答(1 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!