(bug)pcviewer built-in function require Lidar Toolbox ?

I am using the latest version of MATLAB R2026a. When I tried running the example under pcviewer - Visualize and inspect large 3-D point cloud - MATLAB, I encountered the following error:
Error using toolboxdir (line 41) Could not locate the base directory for lidar. Error in vision.internal.pcviewer.pcviewer Error in vision.internal.pcviewer.pcviewer Error in pcviewer (line 6) viewerObj = vision.internal.pcviewer.pcviewer(varargin{:});
After investigation, I found that the issue was caused by the pcviewer function. Then I used dependencyAnalyzer to analyze the file PlotSphericalPointCloudTextureMappingExample.m and discovered that it only had dependencies on MATLAB and the Computer Vision Toolbox.
These toolboxes are already installed in my local environment. I suspected that it might also depend on the Lidar Toolbox. After I additionally installed the Lidar Toolbox, the error no longer occurred.

2 Comments

Maybe the Live Script is the problem ? According to the documentation, the Lidar Toolbox should only be necessary when loading or analyzing .las and .laz files.
Further if you are displaying massive datasets, pcviewer can build an octree structure to maintain high interaction speeds. Creating this spatial structure requires the Lidar Toolbox; without it, displaying all points might decrease interaction performance on some graphics cards. I don't know if this is the case for the example you test.
If the problem remains for the "usual" MATLAB code below, you can submit a bug report.
numFaces = 2500;
[x,y,z] = sphere(numFaces);
%Load an image into the workspace, then map it to the coordinates of the point cloud points.
I = imresize(imread("visionteam1.jpg"),size(x));
color = flipud(im2double(I));
color = reshape(color,[],3);
%Create a point cloud object with the location of the sphere and the color from the image.
ptCloud = pointCloud([x(:) y(:) z(:)], Color=color);
%Visualize the point cloud, and optionally interact with it using the viewer controls.
pcviewer(ptCloud);
Thank you for your quick reply. I did run it in Live Script (plain live .m file) before. Later, I copied the code to the command window and it also gave errors. The code I used was exactly the one you posted, and I did not use .las or .laz files. I will consider submitting a bug report later.

Sign in to comment.

Answers (0)

Products

Release

R2026a

Asked:

on 26 May 2026 at 6:32

Commented:

about 15 hours ago

Community Treasure Hunt

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

Start Hunting!