My idea is to find near by line segments for a given line segment using r-tree data structure. I found opencv library also contains R-tree but I really do not know how to use this r-tree functions.

If i say about my data; i have end point coordinates of each line segment and also I gave a unique number for each line.

Currently, I am using opencv2.1.0 and I want to use r-tree structures via opencv2.1.0.

if anyone knows how to use r-tree in opencv2.1.0 for 2D line segments, please show me the way and give some examples. to make clear.

i want efficient way that's why i am looking for r-tree.

This post has been edited by **g_niro**: 26 January 2013 - 12:48 PM