I have the following general problem,
I presuppose an image is the addition of $K$ other images
$$f(x) = \sum_{k=1}^{K} f_k(x)$$
but I don't know what they are.
At each point in an image I obtain $K$ values that represent each of these images, but the order is unknown. In my particular case, these are orientation values.
$$\mathbf{g} = \{ g_j \mid j = 1 ... K\}$$
At each point, I wish to uniquely assign each value $g_j$ to each of $K$ images, based on the similarity to their neighbours. For example, for a 3x3 image with $K=2$ and $\mathbf{g}$ given by
[0,1] [0,1] [1,0]
[1,0] [1,0] [1,0]
[0,1] [1,0] [0,1]
the two minimal energy sets would be, for some energy function that compares differences,
0 0 0 1 1 1
0 0 0 and 1 1 1
0 0 0 1 1 1
I imagine this would require some kind of iterative optimisation process, but before reinventing the wheel I wonder if any one has come across this problem before and knows a good solution?