How to get data points within current camera view?

조회 수: 12 (최근 30일)
Simon
Simon 2021년 6월 22일
댓글: Simon 2021년 6월 24일
I have a scatter3 plot displaying some (3D) point cloud data. I then use the zoom, pan, rotate, ... interactions to find the scene I'm interessted in.
Now I'd like to get only the currently visible part of the point cloud data which is displayed in the plot. So what I'm looking for is something like a "reverse-function" of camlookat. camlookat moves the camera to view a given object. I'm looking for a function that gives me all objects (or point cloud data) for a given camera position.
I'm thinking about transforming all data into the coordinate system of the camera. One could then find all points which lie in the camera's field of view...
Any ideas / hints on this?
  댓글 수: 1
Simon
Simon 2021년 6월 24일
To be a little more precise: I’m using pcshow, which apparently generates a scatter(3) plot.
load('xyzPoints');
h=pcshow(xyzPoints);
disp(h.Children.Type);
Output:
scatter
See my comment below.

댓글을 달려면 로그인하십시오.

답변 (1개)

Joseph Cheng
Joseph Cheng 2021년 6월 22일
편집: Joseph Cheng 2021년 6월 22일
So... if i'm not mistaken pan in matlab moves the axes limits of the plot and not panning/translating the camera, similarly zooming as well. It not moving a camera/POV like in CAD/real life. Because of that if i have 2 points on the X axis at 0 and 100, then center and zoom in on 0 then rotate to look down the X axis to "see" x==100 is, it wouldn't draw depending on what the plotted x axis limit is. because of that couldn't you just orientate your view then use the axis handle to get the xlim, ylim and zlim of the 3d display to then bound the xyz point cloud for values within the xyz axes region?
  댓글 수: 2
Simon
Simon 2021년 6월 23일
Thanks for your input, Joseph!
Query xlim, ylim and zlim was my first thought as well. But zoom, pan, rotate, ... seems only to change the camera's parameter (CameraPosition, CameraTarget, CameraUpVector, ...).
Maybe I wasn't exactly precise in my initial post. In fact I’m using pcshow, which apparently generates a scatter3 plot.
So what I did for testing was the following. I use pcshow to display some data and examine the properties of the current axes:
load('xyzPoints');
pcshow(xyzPoints);
get(gca)
After using the figure’s zoom, pan, rotate, ... interactions I query the axes properties once more:
get(gca)
The diffed output then looks as following:
As you can see the xlim, ylim, zlim properties are not changed!
Joseph Cheng
Joseph Cheng 2021년 6월 23일
oof... not familiar with pcshow and don't have that toolbox... i'll come back if i think of anything from your pasted handles data

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Point Cloud Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by