error: no matching function for call to ‘drawMatches(cv::Mat&, std::vector<std::vector<cv::KeyPoint> >&, cv::Mat&, std::vector<std::vector<cv::KeyPoint> >&, std::vector<cv::DMatch>&, cv::Mat&)’
时间: 2023-07-02 17:09:17 浏览: 118
这个错误通常是因为 `cv::drawMatches` 函数的参数类型不匹配导致的。你需要检查以下几点:
1. 检查 `cv::drawMatches` 函数的参数类型是否正确,尤其是输入图像的类型是否正确(比如是 `CV_8UC1` 还是 `CV_8UC3`)。
2. 检查输入的关键点和匹配对是否正确。确保它们被正确地传递给了 `cv::drawMatches` 函数。
3. 检查 OpenCV 版本是否正确。有些版本的 OpenCV 可能不支持某些函数或参数。
如果以上方法都不起作用,你可以尝试在 OpenCV 官方文档中查找更多信息,或者尝试与 OpenCV 社区寻求帮助。
相关问题
error: no matching function for call to ‘pcl::PointIndices::PointIndices(std::vector<int>&)
这个错误是因为pcl::PointIndices构造函数的参数类型应该是const std::vector<int>&,而您传递的是std::vector<int>&,也就是说它要求传入一个常量引用,而您传入的是一个非常量引用,因此无法匹配。您可以将代码中的
```c++
std::vector<int> indices(2);
```
改成
```c++
const std::vector<int> indices{ 0, 2 };
```
或者使用下面的方式进行初始化:
```c++
std::vector<int> indices{ 0, 2 };
const pcl::PointIndices::Ptr inliers(new pcl::PointIndices);
inliers->indices = indices;
```
这样就可以避免这个错误了。
error: no matching function for call to 'std::vector<int>::erase(int)'|
这个错误的意思是你尝试从一个 vector 中删除一个整数,但是你提供的参数类型不正确。std::vector 的 erase 函数接受一个迭代器作为参数,而不是一个整数。你需要使用迭代器来删除 vector 中的元素。例如,如果你要删除 vector 中的第三个元素,你可以这样写:
```
std::vector<int> myVector = {1, 2, 3, 4};
auto it = myVector.begin() + 2; // 获取第三个元素的迭代器
myVector.erase(it); // 删除第三个元素
```
这样就可以正确删除 vector 中的元素了。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_lunwen.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)