我嘗試使用C++(https://sites.google.com/site/roboticssaurav/strokewidthnokia)上編寫的文本檢測應用程序,但代碼處於掛起狀態。我發現這個問題的根源在於其中一個函數使用大型圖形50 K頂點和150 K邊緣,並且所有代碼都會在調用鄰接列表「clear」時掛起。在提高鄰接列表上掛起明確
std::vector< std::vector<Point2d> >
findLegallyConnectedComponents (IplImage * SWTImage,
std::vector<Ray> & rays)
{
...
typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS> Graph;
...
Graph g(num_of_vertices);
...
}
離開這個函數後,g.clear()會被調用,程序掛在這個上面。我如何擺脫這個bug?謝謝。
尼斯趕上...這個確切的問題把我難住了。 – zorlack 2013-03-07 21:41:20