Convert jpg into a 2d array then stack the array to form a 3d figure out of the array
1 view (last 30 days)
Show older comments
I=imread('image.jpg'); I am using this line of code above to copy the jpg into a 2D array. I have ensured that the image is 256x256. What I want to do is stack this image on top of itself 256 times so i end up with a figure that is 256x256x256 and I want to then display this figure using
p3d1 = patch(isosurface(nameOf3DArray,0)); set(p3d1,'FaceColor','red','EdgeColor','none');
I cant figure out how to copy the 2D array over into a 3D array. I know it should be as simple as a for loop but I am new to matlab and cant seem to get the syntax correctly. Any help is greatly appreciated.
0 Comments
Answers (1)
Image Analyst
on 10 Dec 2016
To add a 2D image onto another 2D image or 3D image to get another 3D image, you can use cat
image3d = cat(3, image3d, image2d);
0 Comments
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!