pcshow() in gui

7 views (last 30 days)
Yonatan Chatzinoff
Yonatan Chatzinoff on 14 Mar 2017
Answered: Márcio Marques on 27 Jul 2017
Hi all, I am using the Computer Vision toolbox to visualize point cloud data in a gui, and I keep on running into an error as follows. I call pcshow() and it works one time, but on the second call to pcshow(), I get the very long error
Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element.
Error in vision.internal.pc.initializePCSceneControl>localRotateStopMode (line 79)
btn.State = 'off';
Error in hgfeval (line 62)
feval(fcn{1},varargin{:},fcn{2:end});
Error in matlab.uitools.internal.uimode/modeControl (line 22)
hgfeval(hThis.ModeStopFcn);
Error in matlab.uitools.internal.uimode/set.Enable (line 173)
obj.Enable = modeControl(obj,value);
Error in matlab.uitools.internal.uimodemanager>localSetMode (line 173)
set(currMode,'Enable','off');
Error in matlab.uitools.internal.uimodemanager/set.CurrentMode (line 111)
obj.CurrentMode = localSetMode(obj,value);
Error in activateuimode (line 27)
set(hManager,'CurrentMode',hMode);
Error in rotate3d>setState (line 316)
activateuimode(fig,'Exploration.Rotate3d');
Error in rotate3d (line 226)
setState(hTarget,arg2,rotatestyle)
Error in vision.internal.pc.initializePCSceneControl>initUIMode (line 134)
rotate3d(hFigure,'on');
Error in vision.internal.pc.initializePCSceneControl (line 13)
initUIMode(hFigure);
Error in pcshow (line 132)
vision.internal.pc.initializePCSceneControl(hFigure, currentAxes, vertAxis,...
This error does not appear when I use pcshow() in contexts other than GUI (eg, direct successive calls to pcshow() with hold on, multiple subplots, etc).
If anyone has any thoughts I'd appreciate a tip! Thanks Yoni
  3 Comments
Rida Khan
Rida Khan on 30 Mar 2017
Were either one of you able to solve the problem? I'm running into the same error and would really appreciate some help!
Krzysztof Gawlik
Krzysztof Gawlik on 12 Apr 2017
The only way I found is to use scatter3 (slower) or plot3 with '.' sign (as fast as pcshow). But if you want to store all point clouds in suitable object and then view them together, just follow this simple steps:
  1. In for loop store every point cloud (stored in cell array before) in auto incrementing vector, e.g.:
  2. Create point cloud using pointCloud function
  3. View it using pcshow :)
for i=1:size(X,1) % X is our cell array storing all
% point clouds with m x n dimensions.
xcoor = [xcoor, pointCloud.Location(:,1)];
ycoor = [ycoor, pointCloud.Location(:,2)];
zcoor = [zcoor, pointCloud.Location(:,3)];
end
pointCloudOut = pointCloud([xcoor,ycoor,zcoor]);
pcshow(pointCloudOut);

Sign in to comment.

Answers (1)

Márcio Marques
Márcio Marques on 27 Jul 2017
I have exactly the same problem!! Anyone can help?

Community Treasure Hunt

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

Start Hunting!