Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to group points using treshold?

I have points list , from rectangle detector

points_list = [(1853, 1054), (1900, 1068), (75, 68), (74, 157), (10,500), (1700, 10), (1750,15) ]

threshold = 300 # X or Y distance between points How to group point using threshold? I need result:

[[(1853, 1054), (1900, 1068)], [(75, 68), (74, 157)], [(10,500)], [(1700, 10), (1750,12)]]

image description

I tried cv2.groupRectangles, but I need group points.