Compute edge weights directly on GPU
simeks opened this issue · comments
In its current form, the hybrid optimizer computes and stores the energy function in three directions (positive directions) for each voxel (E00, E01, E10, E11). These are transferred to the CPU and converted to a graph represantation as described by V. Kolmogorov et al. "What Energy Functions Can Be Minimized via Graph Cuts?". This results in a buffer of 4*3*n
floats. Another approach would be to compute the graph edge weights directly on the GPU. This would result in a buffer of only 2*3*n
floats, effectively halving the size of the buffer and also the amount of data required to be synchronized.
There are some kinks to work out though. Primarily, the regularization kernel would be required to write to the unary buffers (terminal weights) as well. There are definitely room for race conditions when updating the neighbouring terminal weights.
Doesn't seem to make any significant performance difference and it mostly complicates things. Computing the potentials, rather than the edge weights, allows for arbitrary energy minimization strategy, not only graph cut.