Effacer les filtres
Effacer les filtres

In 3D plot, how is the image displayed on a specific 3D spatial plane?

31 vues (au cours des 30 derniers jours)
cui,xingxing
cui,xingxing le 26 Août 2022
Commenté : cui,xingxing le 26 Août 2022
I am trying to display my image on a certain plane in 3D plot space, for example by displaying one of matlab's own images "peppers.png" to a fixed position, during which I try to display the image using image or imshow build in function+view(3), but the default image position is (0, 0,0), By looking at the image function properties documentation, I only see the x,y position setting property, but not the z axis,I can't change its Z position, what should I do?
your answer would be like greatly apperaciate!
srcImg = imread("peppers.png");
figure;hold on;view(3)
% hAxis = gca;
% hAxis.XRuler.FirstCrossoverValue = 0; % X crossover with Y axis
% hAxis.XRuler.SecondCrossoverValue = 0; % X crossover with Z axis
% hAxis.YRuler.FirstCrossoverValue = 0; % Y crossover with X axis
% hAxis.YRuler.SecondCrossoverValue = 0; % Y crossover with Z axis
% hAxis.ZRuler.FirstCrossoverValue = 0; % Z crossover with X axis
% hAxis.ZRuler.SecondCrossoverValue = 0; % Z crossover with Y axis
image(srcImg);

Réponse acceptée

Chunru
Chunru le 26 Août 2022
srcImg = imread("peppers.png");
sz = size(srcImg);
[xx, yy] =meshgrid(1:sz(1), 1:sz(2));
zz = ones(size(xx)); % set the z value
figure;hold on;view(3)
warp(xx, yy, zz, srcImg)
%image(srcImg);

Plus de réponses (1)

KSSV
KSSV le 26 Août 2022

Catégories

En savoir plus sur Graphics Object Programming dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by