Main Content

extractFPFHFeatures

Extract fast point feature histogram (FPFH) descriptors from point cloud

Since R2020b

Description

features = extractFPFHFeatures(ptCloudIn) extracts FPFH descriptors for each valid point in the input point cloud object. The function returns descriptors as an N-by-33 matrix, where N is the number of valid points in the input point cloud.

features = extractFPFHFeatures(ptCloudIn,indices) extracts FPFH descriptors for the valid points located at the specified linear indices, indices.

example

features = extractFPFHFeatures(ptCloudIn,row,column) extracts FPFH descriptors for the valid points at the specified 2-D indices of the input organized point cloud ptCloudIn. Specify the row and column indices of the points as row and column, respectively.

[___,validIndices] = extractFPFHFeatures(___) returns the linear indices of valid points in the point cloud for which FPFH descriptors have been extracted.

[___] = extractFPFHFeatures(___,Name,Value) specifies options using one or more name-value pair arguments in addition to any combination of arguments in previous syntaxes.

Descriptors can be extracted using KNN search method, radius search method or a combination of both. The extractFPFHFeatures function uses KNN search method to extract descriptors by default. The users can choose the method of extraction through the name-value pair arguments. For example, 'NumNeighbors',8 selects the KNN search method to extract descriptors and sets maximum number of neighbors to consider in the k-nearest neighbor (KNN) search method to eight.

Examples

collapse all

Load point cloud data into the workspace.

ptObj = pcread('teapot.ply');

Downsample the point cloud.

ptCloudIn = pcdownsample(ptObj,'gridAverage',0.05);

Extract FPFH descriptors for the points at specified key indices.

keyInds = [6565 10000];
features = extractFPFHFeatures(ptCloudIn,keyInds);

Display the key points on the point cloud.

ptKeyObj = pointCloud(ptCloudIn.Location(keyInds,:),'Color',[1 0 0;0 0 1]);
figure
pcshow(ptObj)
title('Selected Indices on Point Cloud')
hold on
pcshow(ptKeyObj,'MarkerSize',1000)
hold off

Figure contains an axes object. The axes object with title Selected Indices on Point Cloud contains 2 objects of type scatter.

Display the extracted FPFH descriptors at key points.

figure
ax1 = subplot(2,1,1);
bar(features(1,:),'FaceColor',[1 0 0])
title('FPFH Descriptors of Selected Indices')
ax2 = subplot(2,1,2);
bar(features(2,:),'FaceColor',[0 0 1])
linkaxes([ax1 ax2],'xy')

Figure contains 2 axes objects. Axes object 1 with title FPFH Descriptors of Selected Indices contains an object of type bar. Axes object 2 contains an object of type bar.

Input Arguments

collapse all

Point cloud, specified as a pointCloud object.

Linear indices of selected points, specified as a vector of positive integers.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Row indices of selected points in an organized point cloud, specified as a vector of positive integers.

The row and column vectors must be of the same length.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Column indices of selected points in an organized point cloud, specified as a vector of positive integers.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'NumNeighbors',8 sets the maximum number of neighbors to consider in the k-nearest neighbor (KNN) search method to eight.

Number of neighbors for the KNN search method, specified as the comma-separated pair consisting of 'NumNeighbors' and a positive integer.

KNN search method calculates the distance between a point and its adjacent points in a point cloud and sorts them in ascending order. Closest points are considered as neighbors. 'NumNeighbors' sets the upper limit for the number of neighbors to consider.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Radius considered for radius search method, specified as the comma-separated pair consisting of 'Radius' and a positive real-valued scalar.

Radius search method sets a particular radius around a point and selects all the adjacent points within that given radius as neighbors.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Note

If you specify values for both the 'NumNeighbors' and 'Radius' name-value pair arguments, the extractFPFHFeatures function performs the KNN search method, and then selects only those of that set within the given radius.

If you specify large values for 'NumNeighbors' and 'Radius', the memory footprint and computation time increase.

Output Arguments

collapse all

FPFH descriptors, returned as a N-by-33 matrix of positive real values. N is the number of valid points from which the function extracts FPFH descriptors. Each column contains the FPFH descriptors for a valid point in the point cloud. To additionally return the indices of the extracted points, use the validIndices output argument.

Data Types: double

Linear indices of valid points, specified as a vector of positive integers. The vector contains the indices of only those points for which the function extracts features.

Data Types: double

References

[1] Rusu, Radu Bogdan, Nico Blodow, and Michael Beetz. "Fast point feature histograms (FPFH) for 3D registration." In 2009 IEEE International Conference on Robotics and Automation, pp. 3212-3217. IEEE, 2009.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2020b

See Also

Functions

Objects