这是我使用的代码:
string path = "C:\\Users\\Me\\Desktop\\private\\MachinLearning";
boost::filesystem::directory_iterator iterator(path);
Mat imgIter;
for (; iterator != boost::filesystem::directory_iterator(); ++iterator)
{
string file_name = path;
file_name.append(iterator->path().filename().string());
imgIter = cv::imread(file_name, CV_LOAD_IMAGE_GRAYSCALE);
Mat scalled_img(75, 135, imgIter.type(), cv::Scalar(0.0f, 0.0f, 0.0f));
cv::resize(imgIter, scalled_img, scalled_img.size());
}
我不确定我做错了什么。