Get current view point (az,el) of a point cloud displayed in using "pcshow" command

25 vues (au cours des 30 derniers jours)
Randika Vithanage
Randika Vithanage le 2 Fév 2018
Commenté : Craig le 13 Juin 2025
Hi all,
Could you please let me know how to get the current view point of a point cloud which is displayed using "pcshow" command? Basically, I want to rotate a point cloud manually to get the best view and duplicated the same view point in multiple point clouds. I have tried using below solution but no luck.
Cheers.

Réponses (2)

Walter Roberson
Walter Roberson le 2 Fév 2018
pcshow() returns an Axes object, which you can retrieve the View property of to get the AZ, EL pair, or you can call view() with no argument to get the transformation matrix.
  2 commentaires
Randika Vithanage
Randika Vithanage le 15 Fév 2018
Modifié(e) : Randika Vithanage le 15 Fév 2018
Many thanks Walter. I tired by extracting az,el but it doesn't duplicate the manually rotated view. Instead it gives something different. Therefore, could you please let me know how to rotate using the transformation matrix. Cheers.
Walter Roberson
Walter Roberson le 15 Fév 2018
At the moment I do not know how to take the transformation matrix returned by view() with no parameters and use it in a different axes.

Connectez-vous pour commenter.


Alireza Manzoori
Alireza Manzoori le 23 Jan 2025
Modifié(e) : Alireza Manzoori le 23 Jan 2025
For anyone still looking for an answer to this question:
I found one way to do this (possibly not optimal, but it works). When I get the CameraPosition and CameraUpVector properties of the axis object, and set these properties on a new set of axes to the same values, it seems to replicate the view.
For example:
figure;
axHandle1 = pcshow(pointCloud); % visualize the point cloud and get the axis handle
%% Now in the figure window, manually rotate the view to get the desired angle...
desiredCameraPos = axHandle1.CameraPosition; % read the current CameraPosition value
desiredCameraUpVec = axHandle1.CameraUpVector;% read the current CameraUpVector value
figure; % open a new figure
axHandle2 = pcshow(pointCloud);
axHandle2.CameraPosition = desiredCameraPos;
axHandle2.CameraUpVec = desiredCameraUpVec; % these lines will rotate the figure to the same view
Hope this helps!

Catégories

En savoir plus sur Image Processing and Computer Vision dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by