Matlab Register Point Clouds logo

Matlab Register Point Clouds

OrganizationPopular
matlab
matlab-register-point-clouds

Register 3-D point clouds using ICP, NDT, LOAM, FGR, phase correlation, and CPD algorithms. Use when registering or aligning 3-D point clouds, choosing a registration algorithm, tuning registration parameters, preprocessing point clouds for registration or combining point clouds after registration.

Overview

Publishermatlab
Repositorymatlab-agentic-toolkit
Skill namematlab-register-point-clouds
Stars
1.2K
Forks
138
Bundled files
1
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by matlab on GitHub. Read the source before you install it.

Installation

Install the Matlab Register Point Clouds AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/image-processing-and-computer-vision/matlab-register-point-clouds
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/matlab/matlab-agentic-toolkit.git /tmp/matlab-agentic-toolkit
mkdir -p .claude/skills
cp -r /tmp/matlab-agentic-toolkit/skills-catalog/image-processing-and-computer-vision/matlab-register-point-clouds .claude/skills/matlab-register-point-clouds
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Matlab Register Point Clouds in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Matlab Register Point Clouds on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Matlab Register Point Clouds is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Point Cloud Registration

Select pcregistericp with Metric="planeToPlane" as the starting point, evaluate algorithm accuracy using RMSE, and align the point clouds using pcalign.

When to Use

  • User asks to register, align or match 3-D point clouds represented as pointCloud objects
  • User needs to choose or tune a registration algorithm
  • User wants to build a map from multiple lidar scans
  • User wants to combine or merge registered point clouds
  • User asks about initial transformation estimation for registration
  • User asks to preprocess point clouds before registration

When NOT to Use

  • User wants to register 2-D point clouds (use matchScans, matchScansGrid, or matchScansLine)
  • User wants image registration (use imregtform or imregcorr from Image Processing Toolbox)

Required Toolboxes

  • Computer Vision Toolbox
  • Lidar Toolbox

Legacy Patterns to Avoid

Do NOT useUse insteadWhy
rigid3d for InitialTransformrigidtform3drigidtform3d uses the premultiply transformation convention, which is more commonly used.

Algorithm Selection Guide

Local Registration

If you have an initial transformation or the point clouds are only slightly misaligned, try these local registration methods in this order. Use the RMSE output as the accuracy metric to minimize.

AlgorithmFunctionNotes
Generalized ICP (plane-to-plane)pcregistericp with Metric="planeToPlane"Default starting point. Additionally, try "planeToPlaneWithColor" if the point cloud has color.
ICP (point-to-plane)pcregistericp with Metric="pointToPlane"Additionally, try "pointToPlaneWithColor" if the point cloud has color.
ICP (point-to-point)pcregistericp with Metric="pointToPoint"Simplest metric. Try if plane-based metrics are inaccurate.
LOAMpcregisterloamRequires organized point clouds. If the point cloud is not organized, but you have the lidar parameters available, use pcorganize to organize the point cloud. Use detectLOAMFeatures first to tune feature detection. It gives you more flexibility on the accuracy vs speed tradeoff since detectLOAMFeatures has parameters to control the number of features.
NDTpcregisterndtTune the gridStep parameter for the scale of the scene.

Ground Data Registration

If you don't have an initial transformation, but you know that the data corresponds to ground data, try phase correlation.

AlgorithmFunctionNotes
Phase CorrelationpcregistercorrSpecifically designed for ground data. Not a local registration method.

Global Registration

If there is no initial transformation and the point clouds are significantly misaligned (overlap less than 50%), first use a global registration approach to align the moving point cloud to the fixed point cloud, then optionally use a local registration method as a refinement step to improve accuracy. Note that global registration approaches are usually slower than local ones.

AlgorithmFunctionNotes
FGRpcregisterfgrFeature-based approach.
CPD (rigid)pcregistercpd with Transform="Rigid"Probabilistic framework. It handles outliers well. Use for small point clouds.
CPD (nonrigid)pcregistercpd with Transform="Nonrigid"Only option for non-rigid/deformable registration.
FPFH feature matchingextractFPFHFeatures + pcmatchfeatures + estgeotform3dExtract FPFH descriptors, match features, and estimate the transformation using the MSAC algorithm (a variant of RANSAC). Tune NumNeighbors in extractFPFHFeatures and gridStep in pcdownsample to ensure enough features and feature matches.

General Guidelines

  • The initial transformation is the transformation that aligns the moving point cloud to the fixed point cloud. It is important to set the InitialTransform name-value argument for local registration algorithms when an estimate is available. If registering a sequence of point clouds and no other estimate is available, assume constant speed and set the initial transformation to the transformation estimated between the previous pair of point clouds.
  • The RMSE output of pcregisterfgr is not comparable to the RMSE output of the other registration functions because it is the root mean squared error between only inlier points. Use the Point Cloud Registration Analyzer app for comparable RMSE values between all registration approaches.
  • When comparing registration algorithms, check if the point clouds are organized (i.e., ndims(ptCloud.Location) == 3). If they are organized, include LOAM in the comparison. If they are not organized, but lidar parameters are available (e.g., from the sensor metadata or the user), use pcorganize to organize the point clouds and include LOAM in the comparison. Exclude LOAM when the point clouds are unorganized and no lidar parameters are available.
  • When registering a sequence of organized point clouds with LOAM, use pcmaploam to refine the transformations and improve map accuracy in addition to pairwise pcregisterloam registration.
  • Use pcshowpair to visualize the alignment between a pair of registered point clouds.

Preprocessing Steps

  • When using select to filter points from an organized point cloud, always set OutputSize="full" to preserve the organized structure.
  • To improve the speed and accuracy of the registration, use findPointsInCylinder as a cylindrical filter to remove artifacts from the ego vehicle and noise from distant points. Only use findPointsInCylinder for point clouds from spinning lidar sensors.
  • Downsampling can speed up registration and improve accuracy by removing the effects of noisy points. Use pcdownsample to downsample the point clouds before registration. The recommended approach for registration is the gridAverage or the gridNearest methods. gridAverage is faster and gridNearest returns more accurate color, normal, and intensity values if available in the point cloud.
  • Ground removal is not recommended since it can introduce misalignment in the XY plane. In some scenarios it helps speed up registration and improve accuracy, but first evaluate registration results without ground removal. Then, use either segmentGroundSMRF for more accurate ground removal or pcfitplane to get a faster approximation of the ground points.

Parameter Tuning

When tuning parameters, try a range of values between the typical values listed below (choose a step so that it does not exceed 10 values to try). Then, narrow it down further by trying values closer to the best result from that round. The best result corresponds to the lowest RMSE.

Preprocessing Functions
FunctionParameterTypical RangeTuning Strategy
findPointsInCylinderradius(2) (max radius)90%–100% of point cloud extentCompute extent as max(abs([ptCloud.XLimits, ptCloud.YLimits])). Try without findPointsInCylinder too.
findPointsInCylinderradius(1) (min radius)0–10Must be less than radius(2). Keep small until it fully removes the ego vehicle.
pcdownsamplegridStep0.01–1.0
Registration Functions
FunctionParameterTypical RangeTuning Strategy
pcregistericpMetricAll metric valuesTry each metric.
pcregistericpInlierRatio0.5–1.0 (default: 1)
pcregisterndtgridStep0.01–1.5
pcregisterndtOutlierRatio0.1–1.0 (default: 0.55)
pcregisterloam / LOAMPoints / downsampleLessPlanargridStep0.1–2.0
pcregisterloam / detectLOAMFeaturesNumRegionsPerLaser4-15 (default: 6)Try increasing to extract more features. The value must be an integer.
pcregisterloam / detectLOAMFeaturesMaxSharpEdgePoints, MaxPlanarSurfacePointsAbove defaults of 1Try increasing to extract more features. The value must be an integer.
pcmaploamvoxelSize0.1–2.0
pcmaploam / findPoseSearchRadius2–5 (default: 3)
pcregisterfgrgridSize0.01–1.5
pcregistercpdOutlierRatio0.1–0.9 (default: 0.1)
pcregistercorrgridSize50–250
pcregistercorrgridStep0.01–1.5
pcmatchfeaturesMatchThreshold0.01–1.0 (default: 0.01)Increase to allow more matches.
pcmatchfeaturesRejectRatio0.9–0.99 (default: 0.95)Increase if getting 0 matches.
estgeotform3dMaxDistance0.1–5.0 (default: 1.0)Decrease for stricter inlier filtering.

Combining Point Clouds

  • If you found transformations that align a sequence of point clouds, use pcalign to combine them efficiently. pcalign applies a grid filter across the resulting point cloud to eliminate duplicate points, producing a uniformly dense point cloud.
  • If you are combining point clouds that were already transformed using pctransform and you need to preserve every point without any downsampling, use pccat. pccat is the fastest approach since it only concatenates points, but results in a larger point cloud with potential duplicates that can affect the speed and accuracy of downstream workflows.
  • If you are combining just 2 point clouds at a time that were already transformed using pctransform and you want to downsample only the region of overlap to remove duplicate points, use pcmerge. Note that the density of the resulting point cloud may not be uniform since downsampling is only applied to the overlap area. pcalign is recommended over pcmerge because it is faster, supports more than 2 point clouds, produces uniform density, and performs the alignment of the point clouds using the transformation from registration.

Interactive Comparison

Use the Point Cloud Registration Analyzer app to visually compare algorithms, tune parameters, and analyze results interactively:

matlab
pointCloudRegistrationAnalyzer

The app supports ICP, NDT, LOAM, FGR, Phase Correlation, and CPD. It provides preprocessing (ROI, downsample, ground removal), side-by-side comparison, and it exports the results to the workspace. It supports registration of a pair of point clouds and currently, it does not support the planeToPlaneWithColor and pointToPlaneWithColor metrics of ICP.

Patterns

Basic Registration

matlab
fixedPtCloud = pcread("scan1.pcd");
movingPtCloud = pcread("scan2.pcd");

[tform,movingReg,rmse] = pcregistericp(movingPtCloud,fixedPtCloud,Metric="planeToPlane");
pcshowpair(movingReg,fixedPtCloud)

Preprocessing: Cylindrical Filter and Downsample

matlab
radius = [4 100];
idx = findPointsInCylinder(ptCloud,radius);
ptCloudFiltered = select(ptCloud,idx,OutputSize="full");
gridStep = 0.1;
ptCloudDownsampled = pcdownsample(ptCloudFiltered,"gridAverage",gridStep);

Registration with Preprocessing

matlab
fixedPtCloud = pcread("scan1.pcd");
movingPtCloud = pcread("scan2.pcd");

% Preprocess
radius = [4 100];
gridStep = 0.1;
fixedIdx = findPointsInCylinder(fixedPtCloud,radius);
fixedFiltered = select(fixedPtCloud,fixedIdx,OutputSize="full");
fixedDownsampled = pcdownsample(fixedFiltered,"gridAverage",gridStep);
movingIdx = findPointsInCylinder(movingPtCloud,radius);
movingFiltered = select(movingPtCloud,movingIdx,OutputSize="full");
movingDownsampled = pcdownsample(movingFiltered,"gridAverage",gridStep);

% Register
[tform,movingReg,rmse] = pcregistericp(movingDownsampled,fixedDownsampled,Metric="planeToPlane");
pcshowpair(movingReg,fixedDownsampled)

Global-to-Local Refinement with FGR and ICP

matlab
gridSize = 0.5;
tformGlobal = pcregisterfgr(movingPtCloud,fixedPtCloud,gridSize);

alignedPtCloudGlobal = pctransform(movingPtCloud,tformGlobal);

[tform,movingReg,rmse] = pcregistericp(alignedPtCloudGlobal,fixedPtCloud, ...
    Metric="planeToPlane");

pcshowpair(movingReg,fixedPtCloud)

NDT Registration

matlab
fixedPtCloud = pcread("scan1.pcd");
movingPtCloud = pcread("scan2.pcd");

gridStep = 0.5;
[tform,movingReg,rmse] = pcregisterndt(movingPtCloud,fixedPtCloud,gridStep);
pcshowpair(movingReg,fixedPtCloud)

LOAM with Feature Detection

matlab
movingFeatures = detectLOAMFeatures(movingOrganized);
fixedFeatures = detectLOAMFeatures(fixedOrganized);

gridStep = 1;
movingFeatures = downsampleLessPlanar(movingFeatures,gridStep);
fixedFeatures = downsampleLessPlanar(fixedFeatures,gridStep);

[tform,rmse] = pcregisterloam(movingFeatures,fixedFeatures);
alignedMovingOrganized = pctransform(movingOrganized,tform);

pcshowpair(alignedMovingOrganized,fixedOrganized)

Phase Correlation for Ground Data

matlab
fixedPtCloud = pcread("scan1.pcd");
movingPtCloud = pcread("scan2.pcd");

% Align ground planes to the X-Y plane
maxDistance = 0.4;
referenceVector = [0 0 1];
groundFixed = pcfitplane(fixedPtCloud,maxDistance,referenceVector);
groundMoving = pcfitplane(movingPtCloud,maxDistance,referenceVector);
tformFixed = normalRotation(groundFixed,referenceVector);
tformMoving = normalRotation(groundMoving,referenceVector);
fixedCorrected = pctransform(fixedPtCloud,tformFixed);
movingCorrected = pctransform(movingPtCloud,tformMoving);

% Register using phase correlation
gridSize = 100;
gridStep = 0.5;
[tform,rmse] = pcregistercorr(movingCorrected,fixedCorrected,gridSize,gridStep);

movingReg = pctransform(movingPtCloud,rigidtform3d(tformFixed.A * tformMoving.A * tform.A));
pcshowpair(movingReg,fixedPtCloud)

FPFH Feature-Based Registration

matlab
fixedPtCloud = pcread("scan1.pcd");
movingPtCloud = pcread("scan2.pcd");

% Downsample
gridStep = 0.5;
fixedDownsampled = pcdownsample(fixedPtCloud,"gridAverage",gridStep);
movingDownsampled = pcdownsample(movingPtCloud,"gridAverage",gridStep);

% Extract FPFH features
neighbors = 40;
[fixedFeature,fixedValidInds] = extractFPFHFeatures(fixedDownsampled, ...
    NumNeighbors=neighbors);
[movingFeature,movingValidInds] = extractFPFHFeatures(movingDownsampled, ...
    NumNeighbors=neighbors);

fixedValidPtCloud = select(fixedDownsampled,fixedValidInds);
movingValidPtCloud = select(movingDownsampled,movingValidInds);

% Match features
indexPairs = pcmatchfeatures(movingFeature,fixedFeature,movingValidPtCloud, ...
    fixedValidPtCloud,Method="Exhaustive",MatchThreshold=1,RejectRatio=0.99);

matchedFixedPtCloud = select(fixedValidPtCloud,indexPairs(:,2));
matchedMovingPtCloud = select(movingValidPtCloud,indexPairs(:,1));

% Estimate the transformation that aligns the matched pairs
tform = estgeotform3d(matchedMovingPtCloud.Location, ...
    matchedFixedPtCloud.Location,"rigid",MaxDistance=2,MaxNumTrials=3000);

movingReg = pctransform(movingPtCloud,tform);
pcshowpair(movingReg,fixedPtCloud)

Combining Registered Point Clouds

matlab
ptCloudArr = [ptCloud1 ptCloud2 ptCloud3 ptCloud4];
tforms = [tform1 tform2 tform3 tform4];
gridStep = 0.01;
ptCloudAligned = pcalign(ptCloudArr,tforms,gridStep);

Incremental Map Building

matlab
ptCloudFiles = dir("scans/*.pcd");
numPtClouds = numel(ptCloudFiles);

tforms = repmat(rigidtform3d(),numPtClouds,1);
ptCloudArr = repmat(pointCloud(zeros(0,3)),numPtClouds,1);

% Preprocessing parameters
radius = [4 100];
downsampleGridStep = 0.1;

% Load and preprocess first frame
ptCloud = pcread(fullfile(ptCloudFiles(1).folder,ptCloudFiles(1).name));
idx = findPointsInCylinder(ptCloud,radius);
ptCloudFiltered = select(ptCloud,idx);
ptCloudArr(1) = pcdownsample(ptCloudFiltered,"gridAverage",downsampleGridStep);

initTform = rigidtform3d();

for i = 2:numPtClouds
    % Load and preprocess
    ptCloud = pcread(fullfile(ptCloudFiles(i).folder,ptCloudFiles(i).name));
    idx = findPointsInCylinder(ptCloud,radius);
    ptCloudFiltered = select(ptCloud,idx);
    ptCloudArr(i) = pcdownsample(ptCloudFiltered,"gridAverage",downsampleGridStep);

    [relTform,~,rmse] = pcregistericp(ptCloudArr(i),ptCloudArr(i-1),Metric="planeToPlane",InitialTransform=initTform);
    tforms(i) = rigidtform3d(tforms(i-1).A * relTform.A);

    initTform = relTform;
end

gridStep = 0.01;
ptCloudMap = pcalign(ptCloudArr,tforms,gridStep);
pcviewer(ptCloudMap)

LOAM Map Building

matlab
voxelSize = 0.1;
loamMap = pcmaploam(voxelSize);
relPose = rigidtform3d();

gridStep = 1;
ptCloud = ptCloudArr(1);
points = detectLOAMFeatures(ptCloud);
points = downsampleLessPlanar(points,gridStep);
addPoints(loamMap,points,rigidtform3d())

tforms = repmat(rigidtform3d(),numPtClouds,1);

for viewId = 2:numPtClouds
   prevPoints = points;
   ptCloud = ptCloudArr(viewId);
   points = detectLOAMFeatures(ptCloud);
   points = downsampleLessPlanar(points,gridStep);

   relPose = pcregisterloam(points,prevPoints,InitialTransform=relPose);

   [absPose,~,rmseRefinement] = findPose(loamMap,points,relPose);
   addPoints(loamMap,points,absPose);
   tforms(viewId) = absPose;
end

ptCloudMap = pcalign(ptCloudArr,tforms,voxelSize);
pcshow(ptCloudMap)

Copyright 2026 The MathWorks, Inc.


Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Matlab Register Point Clouds AI skill do?

Register 3-D point clouds using ICP, NDT, LOAM, FGR, phase correlation, and CPD algorithms. Use when registering or aligning 3-D point clouds, choosing a registration algorithm, tuning registration parameters, preprocessing point clouds for registration or combining point clouds after registration.

Why use Matlab Register Point Clouds on TypingMind?

Because you install it once and use it with any model. Matlab Register Point Clouds is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Matlab Register Point Clouds in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/image-processing-and-computer-vision/matlab-register-point-clouds. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Matlab Register Point Clouds?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Matlab Register Point Clouds?

As many as you like. As long as a model supports skills, you can use Matlab Register Point Clouds with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Matlab Register Point Clouds AI skill free?

It is published on GitHub by matlab. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇