PointCloudLibrary / PointCloudLibrary/pcl
[pcl::2d] Keypoint module implementation is broken and incompatible with updated Convolution/Edge/Kernel classes
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 4.7k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 6
Description
Description
I encountered severe compilation errors and design inconsistencies when trying to use the pcl::2d::Keypoint module. It appears that the implementation of Keypoint in pcl/2d/impl/keypoint.hpp has not been updated to match the current API of its dependencies (pcl::2d::Convolution, pcl::2d::Edge, and pcl::2d::Kernel).
The code seems to rely on legacy methods that no longer exist or have been renamed, and there is a fundamental type incompatibility between Keypoint and Convolution.
Steps to Reproduce
-
Include
pcl/2d/keypoint.h -
Try to instantiate
pcl::Keypointwith a standard PointCloud type or a vector type.#include <pcl/2d/keypoint.h> #include <pcl/point_cloud.h> #include <pcl/point_types.h> int main() { // Define the ImageType that meets the requirements of the source code (no longer PointCloud) using ImageType = std::vector<std::vector<float>>; int width = 20; int height = 20; ImageType input(height, std::vector<float>(width, 0.0f)); ImageType output; for (int r = 5; r <= 15; ++r) { for (int c = 5; c <= 15; ++c) { input[r][c] = 255.0f; } } pcl::Keypoint<ImageType> keypoint; // Args: output, input, sigma_d, sigma_i, alpha, thresh keypoint.harrisCorner (output, input, 1.0f, 2.0f, 0.04f, 1e-5f); // compile error return 0; }
Detailed Errors
I have identified the following critical issues in pcl/2d/impl/keypoint.hpp:
1. Missing Methods in Convolution
The Keypoint implementation calls methods on the conv_2d object (type pcl::Convolution) that do not exist:
- Called:
conv_2d.gaussianKernel(5, sigma, kernel_y);- Reality:
pcl::Convolutionhas nogaussianKernelmethod. This method seems to belong to thepcl::kernelclass.
- Reality:
- Called:
conv_2d.convolve(output, input, kernel_y);- Reality:
pcl::Convolutionuses the standard PCL Filter interface. The method is likelyfilter(), or the class usage is completely wrong here.
- Reality:
2. Missing Methods in Edge
The code calls edge_detection.ComputeDerivativeXCentral(...). However, this method only has a declaration and has not been implemented.
3. Fundamental Type Incompatibility
The pcl::Keypoint class seems to be written assuming ImageType is a std::vector<std::vector<T>> (nested vector), as seen by the access pattern input[i][j] in keypoint.hpp.
However, pcl::Convolution and pcl::Edge explicitly require pcl::PointCloud<PointT> as their template argument and input types.
- If I pass
pcl::PointCloudtoKeypoint:keypoint.hppfails because PointCloud does not support[i][j]indexing (it uses(col, row)or flat indexing). - If I pass
std::vector<std::vector<T>>toKeypoint:convolution.hfails because it expects a class with.width,.heightandpointsmembers.
Environment
- OS: 6.18.5-arch1-1
- Compiler: gcc 15.2.1
- PCL: Master branch
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading pcl/2d/impl/keypoint.hpp alongside the Convolution and Edge APIs in pcl/2d, then compile the minimal std::vector<std::vector> example from the issue. Trace the expected ImageType and update scope, including the missing Gaussian/convolution calls and derivative implementation; done means the Keypoint example compiles against the current APIs without the reported type or method errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100