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

31 次查看(过去 30 天)
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);

采纳的回答

Chunru
Chunru 2022-8-26
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);

更多回答(1 个)

KSSV
KSSV 2022-8-26

类别

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

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by