Cannot select all points in view in brush mode

조회 수: 5 (최근 30일)
John Barrus
John Barrus 2023년 9월 25일
답변: Milan Bansal 2023년 10월 4일
Under certain camera conditions while viewing a pointcloud with pcshow, I cannot select all points in view with the brush. (The same thing happens with using scatter3 -- see the comments)
Here's an example:
pts = [2*rand(200000,1)-0.6981, ...
(2*rand(200000,1)+0.000412), ...
(0.03*rand(200000,1)-0.00202)];
figure;
ax = pcshow(pts,'MarkerSize',20);
ax.CameraPosition = [0.2387 0.0725 0.01536];
ax.CameraViewAngle = 60;
ax.CameraTarget = [-0.1620 0.1982 -0.01704];
ax.CameraUpVector = [-0.2694 0.1696 0.9480];
Using the "Brush Data" mode, I can only select points in roughly the middle 1/3 of the screen. The red rectangle indicating the selection just does't follow the mouse pointer in the top or bottom portion of the screen and I can't select any points in those areas.
However, if I change the camera position
ax.CameraPosition = [0 0 0];
ax.CameraTarget = [0 1 0];
ax.CameraUpVector = [0 0 1];
I can select any points in view and the red rectangle accompanies the mouse pointer as normal. What's going on?
  댓글 수: 2
John Barrus
John Barrus 2023년 9월 25일
It seems like the issue is somewhere in R2023a\toolbox\matlab\datamanager\+datamanager\brushdrag.m. At line 16, no axes are returned here for the case described above.
John Barrus
John Barrus 2023년 9월 25일
Reproducing the same erroneous behavior with scatter3:
pts = [2*rand(200000,1)-0.6981, ...
(2*rand(200000,1)+0.000412), ...
(0.03*rand(200000,1)-0.00202)];
figure;
h = scatter3(pts(:,1),pts(:,2),pts(:,3));
ax = h.Parent;
ax.DataAspectRatio = [1,1,1];
ax.PlotBoxAspectRatio = [66.6650 66.6664 1];
ax.Projection = 'perspective';
ax.CameraPosition = [0.2387 0.0725 0.01536];
ax.CameraViewAngle = 60;
ax.CameraTarget = [-0.1620 0.1982 -0.01704];
ax.CameraUpVector = [-0.2694 0.1696 0.9480];

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

답변 (1개)

Milan Bansal
Milan Bansal 2023년 10월 4일
Hi,
As per my understanding, you are not able to select all the points present in the figure window using "Brush Data" feature.
Using "Brush Data" feature, it is only possible to select the data which falls under the field of view of the camera. The view displayed in the figure window, and the view seen by the camera are not always the same, the view seen by camera depends upon several factor such as "CameraPositon", "CameraTarget" and "CameraViewingAngle". Please refer to the following documentation link for further information on the above properties.
When selecting the points using "Brush Data" feature, the points in the front of the camera and back of the camera gets selected which fall under the field of view. It is possible to verify this by zooming out and changing the position using "3D Rotate" feature.
Please note that using "3D rotate" will change the position of the camera and hence the current view.
Please refer the figure below to see exactly which points were selected using the initial set of camera positions.
Please refer the figure below to see exactly which points were selected using the second set of camera positions.
From first figure it looks like all the points were selected but actually only those points were selected which were present in the field of view of camera.
In order to select all the points, set the "CameraPosition" such that whole view falls under the field of view of camera. Please refer to the example below set the camera position.
ax.CameraPosition = [-0.8 -0.76 0];
ax.CameraTarget = [0 1 0];
ax.CameraUpVector = [0 0 1];
ax.CameraViewAngle = 60;
Please refer to the below MathWorks documentation link to learn more about Camera Graphics Terminologies.
Hope it helps.

카테고리

Help CenterFile Exchange에서 Camera Views에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by