【发布时间】:2014-10-24 09:13:49
【问题描述】:
我已经创建了一个从图像中获得的点列表。但是我有很多图像的问题,所以我想创建一个列表列表。我的想法是创建一个字符串列表(包含图像名称)并将点列表添加到该列表中(字符串列表的每个图像都包含该图像的点列表)。我不知道该怎么做。这是我第一次操作列表。
这是我到目前为止所做的:
struct Point
{
double x, y;
};
list<Point> landmarks;
list<string> image_name;
for (loop over the images that i have in my folder)
{
for (loop over point in every image in the folder image)
{
Point p;
p.x = it_shapeROI->roi.pXmin;
p.y = it_shapeROI->roi.pYmin;
landmarks.push_back( p ); // list of point in one image
}
// Here I want to add to the list of string the list of point.
// So I will have at the end a list of string (image name)
// that contain for every name a list of point of that images.
}
【问题讨论】: