Panorama building using spanning tree
I'm coding some aplication for panorama stitching. I'm using crosscorrelation for calculate relative displacement of each image(only (dx,dy))
So I have matrix(or fully connected graph) of relations between images(peak + (dx,dy) displacement),but algorithm sometimes give "fake/false peaks".
My thoughts:
Find minimum spanning tree(can be false peaks and it does not take into account the geometric relationships).
Some global optimization. (don't sure which function/critiria to minimize).Maybe I can find all spanning trees (or best k spanning trees) and then find best using criteria (sum of peaks)/(number of rect intersections) or maybe sum(pixel difference/intersection area).Number of spanning trees grows fast with grow of number of images, even if I don't use fully connected graph, but cut some connection below threshold.
Maybe there is some opencv-based solution? Also I found this paper but I'm not sure this is my case.
Also found this paper about spanning trees.