How to visualize two images in two intersecting planes?

2 vues (au cours des 30 derniers jours)
yousef Yousef
yousef Yousef le 10 Déc 2022
Commenté : yousef Yousef le 15 Déc 2022
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 commentaires
yousef Yousef
yousef Yousef le 11 Déc 2022
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 le 11 Déc 2022
imwarp() like I indicated earlier.

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 10 Déc 2022
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 commentaires
Walter Roberson
Walter Roberson le 15 Déc 2022
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
yousef Yousef
yousef Yousef le 15 Déc 2022
Perfect. I really appreciate it. Thankyou

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by