为一个vector<cv::KeyPoint*> 类型的变量做初始化

vector<cv::KeyPoint*> keypoints;

int N;

 

keypoints = vector<cv::KeyPoint*>(N, static_cast<cv::KeyPoint*>NULL);  //开辟一块大小为N的内存,都指向空

 

std::fill(keypoints.begin(), keypoints.end(), static_cast<cv::KeyPoint*>(NULL));  //容器已指定了大小,直接全部填为空

posted on 2017-10-16 18:22  defe_feath  阅读(1363)  评论(0编辑  收藏  举报