부스트 그래프 라이브러리에 문제가 있습니다. (이미지 처리 OTB 라이브러리를 사용연결을 알고있는 부스트 인접 그래프에 인접 꼭지점을 만듭니다.
typedef boost::adjacency_list<boost::vecS,
boost::vecS,
boost::undirectedS,
boost::property<boost::vertex_bundle_t, unsigned int>,
boost::property<boost::edge_bundle_t, float>,
boost::no_property> GraphType
I 이미지 정점의 화소마다 작성하는 제 1 루프를 않았다 초기화 단계
는,이 인접 그래프에 이미지를 저장할 , in_iter 이미지의 픽셀에 불과 반복자)입니다 :unsigned long int curr_id = 0;
for(in_iter.GoToBegin(); !in_iter.IsAtEnd(); ++in_iter)
{
boost::add_vertex(curr_id, *_graph);
curr_id++;
}
그리고 지금은 이웃 (4 connexity)와 정점의 연결을 만들려면 : 내가 이것을 시도했지만 작동하지 않습니다 :
curr_id = 0;
long int neighbors[4];
auto iterBounds = boost::vertices(*_graph);
for(auto v_iter = iterBounds.first; v_iter != iterBounds.second; v_iter++)
{
FindNeighboring(curr_id, neighbors, rows, cols);
for(short j = 0; j<4; j++)
{
if(neighbors[j] > -1)
{
boost::add_vertex(*_graph->m_vertices[curr_id],
*_graph->m_vertices[neighbors[j]],
std::numeric_limits<float>::max();
*_graph);
}
}
}
해당 위치를 알고있는 정점 설명자에 액세스하려고합니다. BGL에서 그렇게 할 수 있습니까?
도움 주셔서 감사합니다.