How to visualize two images in two intersecting planes?

8 次查看(过去 30 天)
Hi, I have two images. I need to visualize these images in a way each image will be on a different plane. I'm wondering if this is achievable using MATLAB or any other tool. Pleas have a look at the attached image.
Any help will be appreciated.
Thank you
  4 个评论
yousef Yousef
yousef Yousef 2022-12-11
Thank you for your willing to help me. Please have a look at the attached pictures. I hope it calrifies what I want to do.

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2022-12-10
If you had a volume, you could use slice
However if you have distinct images that you want to place into 3D, then you need to create a surface and texture map the image data onto the surface. You can do that directly with surf() calls, but it is often easier to use warp
  3 个评论
Walter Roberson
Walter Roberson 2022-12-15
Those are not images -- not unless you render the scatter() into a buffer or save it to an image file and read the image out of the file. And even then you only have one of them, since your second x is the same as the first one.
If you have two plots that you want to put into different planes, then the easiest way is to use plot3() or scatter3()
x1 = linspace(0,3*pi,200);
y1 = cos(x1) + rand(size(x1));
z1 = zeros(size(x1));
x2 = x1;
y2 = zeros(size(x2));
z2 = x2 .^ 2 - sin(x2);
subplot(2,1,1);
plot3(x1, y1, z1, 'k*', x2, y2, z2, 'b+')
title('plot3 version')
subplot(2,1,2)
scatter3(x1, y1, z1, 'k*');
hold on
scatter3(x2, y2, z2, 'b+');
hold off
title('scatter3 version')
Are there other approaches? Yes. You can use the following kind of sequence:
  1. create one 2d plot normally, using scatter() or plot.
  2. use hgtransform to create a transform group.
  3. create your second 2d plot, but pass in the handle of the transform group as the 'parent' or as the axes (first parameter) to plot against;
  4. set the Matrix property of the transform group to the rotation / translation / scaling matrix that will act to transform the second plot into the desired location. The makehgtform function is very useful for creating appropriate Matrix. Just remember that the rightmost transform you pass to makehgtform is the one that is executed first
Warning: do not use this sequence to try to rotate an image() object out of the XY plane. image() objects are 2D objects with no thickness, and if you rotate them out-of-plane then they effectively vanish down to a line. To get an image() object to show up outside the XY plane, you need to create a surface object and texture-map the image to the surface. The easiest way to do that is to use warp

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Performance 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by