你可以使用std::vector的size()成员函数来获取std::vector<cv::KeyPoint>的长度。这个函数会返回向量中元素的数量。以下是一个简单的例子: #include <iostream> #include <vector> #include <opencv2/opencv.hpp> int main() { std::vector<cv::KeyPoint> keypoints; // 假设你已经填充了keypoints向量 //...