Image Stitching

Tue 29 May 2012 by Dr. Dirk Colbry

Blog post edited by Anonymous - "Migrated to Confluence 4.0"I have a video stitching program that I wrote in MATLAB to combine twooverlapping videos into one (See figure below):Combining two overlapping videos into one image is an important step in ourscientific workflow for studying chameleons. Without image stitching,researchers need to measure distances between points in different videos.Here is a link to the current MATLAB version.moviestitch.mThe user selects a corresponding point in both images and then “stitches” themtogether using a linearly-weighted mixture of pixel values. We will call theimage in the upper left A and the image in the lower right B. The mixtureregion is the region of overlap between A and B and is the only region we needto adjust. First we calculate the shortest distance in pixels from the upperleft image and the shortest distance in pixels from the lower right image forthe overlap region. We will call these overlap shortest distances SA and SB.Next, we sum the corresponding distance values together from SA and SB to getthe total shortest distance. This will be used to normalize the distances andreturn a value between zero and one. Summing these two images together, we getthe following:Now, to get the weighted ratio WA and WB, we divide SA and SB by the totaldistance. If done correctly, we should be able to add any pixel in WA with thecorresponding pixel in WB and get 1.Finally, we calculate the new pixel value for each pixel in the overlap regionby summing the original pixel values (IA and IB) to the corresponding weightedregion and adding them together: IAWB + IBWA.ViewOnlineBlogpost migrated from ICER Wiki using custom python script. Comment on errors below.


Comments