I have been making an automatic panorama stitcher in python and now stuck in seam finding step. Following is my code in the structure which I understood from opencv docs.