I have a series of points
(x,y) and each point has a colour (in the LAB colour space). I need to associate points by similar colour and then spatially. So the end result is each point becomes part of a local cluster or segment.
Is there a specific data structure that is suited to such a scenario? I'm trying to find a data structure that can efficiently find the n surrounding points of a specific point.
Essentially I need to select point
P and find the surrounding points. For each surrounding point (
Q); measure the Euclidean colour distance between
Q, if the distance is within a threshold, these points get the same label. Then repeat for point
Q is surrounded by points of its own label or points that are too dissimilar to accumulate.
I'm aware of machine learning algorithms that could achieve what I want; SVM (Support Vector Machines) however it is not quite fast enough. If there is a data structure that can perform this faster its more desirable.