Show stacked images in 3D
조회 수: 2 (최근 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!