필터 지우기
필터 지우기

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