hi,
I have many images. Per image, I have a set of lines called wireframe and every wireframe has many other lines extracted from images. I want to create a data stucture to store Image-Wireframe-Ext_lines Triplet. I am not getting any error but output is not expected. Can anyone help me?
Thank u in advance!!
I have defined data stucture like this
::map<int, vector<LineSegment2D> > imagelines2wireframe;
::map<int, vector< ::map<int, vector<LineSegment2D> > > > image_imagelines2wireframe;
My detailed code is:
::map<int, vector<LineSegment2D> > wireframe; //wireframe
::map<int,int> wire_image_no;
::map<int, vector<LineSegment2D> > extlines; // extracted lines
::map<int,int> proj_image_no;
::map<int, vector<LineSegment2D> > imagelines2wireframe;
::map<int, vector< ::map<int, vector<LineSegment2D> > > > image_imagelines2wireframe;
for (::map<int, vector < LineSegment2D> >::iterator it_wire = wireframe.begin(); it_wire != wireframe.end(); it_wire++)
for (unsigned int a = 0; a < it_wire->second.size() ; a++)
{
for (::map<int, vector < LineSegment2D> >::iterator it_img = extlines.begin(); it_img != extlines.end(); it_img++)
if (it_wire->first == it_img->first)
for (unsigned int b = 0; b < it_img->second.size() ; b++)
{
double dis = Distance_LineSegments2D(it_wire->second[a], it_img->second[b], 10);
if (fabs(dis) < 5)
{
cout << it_wire->first <<"\t"<<a<<"\t"<<b<<"\t"<< dis<<endl;
// w->first = a;
imagelines2wireframe[a].push_back(it_img->second[b]);
}
}
if (imagelines2wireframe[a].size())
{ image_imagelines2wireframe[it_wire->first].push_back (imagelines2wireframe); cout<< "1 TRiplet pushed\n";}
}